home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Include / DShowIDL / axextend.idl < prev    next >
Encoding:
Text File  |  2004-09-27  |  176.3 KB  |  5,170 lines

  1. //------------------------------------------------------------------------------
  2. // File: AXExtend.idl
  3. //
  4. // Desc: Extended streaming interface definitions for the ActiveMovie
  5. //       streaming and synchronization architecture.  Core streaming
  6. //       interfaces are in AXCore.idl, and control interfaces for the
  7. //       type library are in Control.odl.
  8. //
  9. // Copyright (c) 1992 - 2000, Microsoft Corporation.  All rights reserved.
  10. //------------------------------------------------------------------------------
  11.  
  12.  
  13. // include after unknwn.idl, objidl.idl and axcore.idl
  14.  
  15.  
  16. // forward declarations - these are the interfaces declared in this file
  17.  
  18. interface IEnumRegFilters;
  19. interface IFileSourceFilter;
  20. interface IFileSinkFilter;
  21. interface IFileSinkFilter2;
  22. interface IGraphBuilder;
  23. interface ICaptureGraphBuilder;
  24. interface ICaptureGraphBuilder2;
  25. interface IAMCopyCaptureFileProgress;
  26. interface IFilterMapper;
  27. interface IFilterMapper2;
  28. interface IMediaEventSink;
  29. interface IOverlay;
  30. interface IOverlayNotify;
  31. interface IOverlayNotify2;
  32. interface IQualityControl;
  33. interface ISeekingPassThru;
  34. interface IAMStreamConfig;
  35. interface IAMDevMemoryAllocator;
  36. interface IAMDevMemoryControl;
  37. interface IConfigInterleaving;
  38. interface IConfigAviMux;
  39. interface IAMVideoCompression;
  40. interface IAMVfwCaptureDialogs;
  41. interface IAMVfwCompressDialogs;
  42. interface IAMDroppedFrames;
  43. interface IAMAudioInputMixer;
  44. interface IAMBufferNegotiation;
  45. interface IAMAnalogVideoDecoder;
  46. interface IAMVideoProcAmp;
  47. interface IAMAnalogVideoEncoder;
  48. interface IAMCameraControl;
  49. interface IAMCrossbar;
  50. interface IAMTVTuner;
  51. interface IKsPropertySet;
  52. interface IAMPhysicalPinInfo;
  53. interface IAMExtDevice;
  54. interface IAMExtTransport;
  55. interface IAMTimecodeReader;
  56. interface IAMTimecodeGenerator;
  57. interface IAMTimecodeDisplay;
  58. interface IDrawVideoImage;
  59. interface IDecimateVideoImage;
  60. interface IAMVideoDecimationProperties;
  61. interface IAMPushSource;
  62. interface IAMAudioRendererStats;
  63. interface IAMLatency;
  64. interface IAMGraphStreams;
  65. interface IAMOverlayFX;
  66. interface IAMOpenProgress;
  67. interface IMpeg2Demultiplexer ;
  68. interface IMPEG2StreamIdMap ;
  69. interface IEnumStreamIdMap ;
  70. interface IAMClockSlave ;
  71. interface IEncoderAPI;
  72. interface IVideoEncoder;
  73. interface IAMGraphBuilderCallback;
  74. interface IAMCertifiedOutputProtection;
  75.  
  76. //==========================================================================
  77. //==========================================================================
  78. // IEnumRegFilters interface -- enumerates registered filters.
  79. // enumerator interface returned from IFilterMapper::EnumMatchingFilters().
  80. // based on IEnum pseudo-template
  81. //==========================================================================
  82. //==========================================================================
  83.  
  84. typedef struct {
  85.     CLSID Clsid;             // class id of the filter
  86.     LPWSTR Name;             // name of filter
  87. } REGFILTER;
  88.  
  89. [
  90. object,
  91. uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770),
  92. pointer_default(unique)
  93. ]
  94.  
  95. // The point of the mapper is to avoid loading filters.  By looking in the
  96. // registry we can reduce the number of filters which must be loaded and tried.
  97. // This enumerator returns descriptors of filters (including the GUIDs that
  98. // CoCreateInstance can instantiate).  The filters themselves are not loaded.
  99.  
  100. interface IEnumRegFilters : IUnknown {
  101.     import "unknwn.idl";
  102.  
  103.     // The caller must use CoTaskMemFree to free each REGFILTER* returned
  104.     // in the array.
  105.     HRESULT Next
  106.         ( [in]  ULONG cFilters,           // place this many filters...
  107.           [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER*
  108.           [out] ULONG * pcFetched         // actual count passed returned here
  109.         );
  110.  
  111.     // I can't think why anyone would want to skip, so it's not implemented.
  112.     // (anyone who thinks they know what they would be skipping over is probably
  113.     // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL.
  114.  
  115.     HRESULT Skip(
  116.         [in] ULONG cFilters
  117.     );
  118.  
  119.     HRESULT Reset(void);
  120.  
  121.     // No cloning either - also ALWAYS returns E_NOTIMPL.
  122.  
  123.     HRESULT Clone(
  124.         [out] IEnumRegFilters **ppEnum
  125.     );
  126. }
  127.  
  128.  
  129. typedef IEnumRegFilters *PENUMREGFILTERS;
  130.  
  131. //========================================================================
  132. //========================================================================
  133. // abstraction representing the registered information about filters.
  134. // This allows properties of filters to be looked up without loading them.
  135. //========================================================================
  136. //========================================================================
  137.  
  138. [
  139. object,
  140. uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770),
  141. pointer_default(unique)
  142. ]
  143. interface IFilterMapper : IUnknown {
  144.     import "unknwn.idl";
  145.  
  146.     //==========================================================================
  147.     // Registration functions.
  148.     // A filter should be registered before any other use.
  149.     // The registration can be NON_VOLATILE (i.e. permanent, do once ever)
  150.     // or VOLATILE (once per boot of the system).
  151.     // UnregisterFilter (obviously) removes the registration.
  152.     // The action of any of the other calls on unregistered filters is undefined.
  153.     // it will either work or you'll get an error, but I'm not saying which.
  154.     //==========================================================================
  155.  
  156.     // Four predefined values controling the order in which filters are tried
  157.     // for intelligent graph building.  Intermediate values are legal.
  158.     // Any value <=MERIT_DO_NOT_USE will mean that the filter will never
  159.     // be tried by the filtergrah to automatically complete a connection.
  160.  
  161.     enum { MERIT_PREFERRED     = 0x800000,
  162.            MERIT_NORMAL        = 0x600000,
  163.            MERIT_UNLIKELY      = 0x400000,
  164.            MERIT_DO_NOT_USE    = 0x200000,
  165.            MERIT_SW_COMPRESSOR = 0x100000,
  166.            MERIT_HW_COMPRESSOR = 0x100050
  167.          };
  168.  
  169.     // Register a filter
  170.  
  171.     HRESULT RegisterFilter
  172.         ( [in] CLSID   clsid,    // GUID of the filter
  173.           [in] LPCWSTR Name,     // Descriptive name for the filter
  174.           [in] DWORD   dwMerit   // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED.
  175.         );
  176.  
  177.  
  178.     // Register an identifiable instance of a filter.  This deals with cases
  179.     // such as two similar sound cards which are driven by the same driver,
  180.     // but we want to choose which oif these cards the sound will come out of.
  181.     // This is not needed if there is only one instance of the filter
  182.     // (e.g. there is only one sound card in the machine) or if all instances
  183.     // of the filter are equivalent.
  184.  
  185.     // The filter itself must have already been registered   // ??? Is that true?
  186.     HRESULT RegisterFilterInstance
  187.         ( [in]  CLSID  clsid,      // GUID of the filter
  188.           [in]  LPCWSTR Name,      // Descriptive name of instance.
  189.           [out] CLSID *MRId        // Returned Media Resource Id.  A
  190.                                    // locally unique id for this instance
  191.                                    // of this filter
  192.         );
  193.  
  194.  
  195.     HRESULT RegisterPin
  196.         ( [in] CLSID   Filter,           // GUID of filter
  197.           [in] LPCWSTR Name,             // Name of the pin
  198.           [in] BOOL    bRendered,        // The filter renders this input
  199.           [in] BOOL    bOutput,          // TRUE if this is an Output pin
  200.           [in] BOOL    bZero,            // TRUE if OK for zero instances of pin
  201.                                          // In this case you will have to Create
  202.                                          // a pin to have even one instance
  203.           [in] BOOL    bMany,            // TRUE if OK for many instances of pin
  204.           [in] CLSID   ConnectsToFilter, // Filter it connects to if it has
  205.                                          // subterranean connection, else NULL
  206.           [in] LPCWSTR ConnectsToPin     // Name of pin it connects to
  207.                                          // NULL for output pins
  208.         );
  209.  
  210.     HRESULT RegisterPinType
  211.         ( [in] CLSID   clsFilter,        // GUID of filter
  212.           [in] LPCWSTR strName,          // Descriptive name of the pin
  213.           [in] CLSID   clsMajorType,     // Major type of the data stream
  214.           [in] CLSID   clsSubType        // Sub type of the data stream
  215.         );
  216.  
  217.  
  218.     HRESULT UnregisterFilter
  219.         ( [in] CLSID  Filter             // GUID of filter
  220.         );
  221.  
  222.  
  223.     HRESULT UnregisterFilterInstance
  224.         ( [in] CLSID  MRId               // Media Resource Id of this instance
  225.         );
  226.  
  227.  
  228.     HRESULT UnregisterPin
  229.         ( [in] CLSID   Filter,           // GUID of filter
  230.           [in] LPCWSTR Name              // Name of the pin
  231.         );
  232.  
  233.  
  234.     // Set *ppEnum to be an enumerator for filters matching the requirements.
  235.  
  236.     HRESULT EnumMatchingFilters
  237.        ( [out] IEnumRegFilters **ppEnum  // enumerator returned
  238.        , [in]  DWORD dwMerit             // at least this merit needed
  239.        , [in]  BOOL  bInputNeeded        // need at least one input pin
  240.        , [in]  CLSID clsInMaj            // input major type
  241.        , [in]  CLSID clsInSub            // input sub type
  242.        , [in]  BOOL  bRender             // must the input be rendered?
  243.        , [in]  BOOL  bOututNeeded        // need at least one output pin
  244.        , [in]  CLSID clsOutMaj           // output major type
  245.        , [in]  CLSID clsOutSub           // output sub type
  246.        );
  247.  
  248. }
  249.  
  250. // structure used to identify media types a pin handles. Used for
  251. // registration through IFilterMapper and IFilterMapper2
  252. //
  253. typedef struct
  254. {
  255.     const CLSID * clsMajorType;
  256.     const CLSID * clsMinorType;
  257. } REGPINTYPES;
  258.  
  259. // describes pin for filter registration. Used for registration
  260. // through IFilterMapper and IFilterMapper2
  261. //
  262. typedef struct
  263. {
  264.     LPWSTR           strName;
  265.  
  266.     // The filter renders this input
  267.     BOOL             bRendered;
  268.  
  269.     // This is an Output pin
  270.     BOOL             bOutput;
  271.  
  272.     // OK to have zero instances of pin In this case you will have to
  273.     // Create a pin to have even one instance
  274.     BOOL             bZero;
  275.  
  276.     // OK to create many instance of  pin
  277.     BOOL             bMany;
  278.  
  279.     const CLSID *    clsConnectsToFilter;
  280.     const WCHAR *    strConnectsToPin;
  281.  
  282.     UINT             nMediaTypes;
  283.     const REGPINTYPES * lpMediaType;
  284. } REGFILTERPINS;
  285.  
  286. // mediums (as defined in the Windows NT DDK) for registration with
  287. // IFilterMapper2
  288. //
  289. typedef struct
  290. {
  291.     CLSID clsMedium;
  292.     DWORD dw1;
  293.     DWORD dw2;
  294. } REGPINMEDIUM;
  295.  
  296. // flags for dwFlags in REFILTERPINS2
  297. enum
  298. {
  299.     // OK to have zero instances of pin In this case you will have to
  300.     // Create a pin to have even one instance
  301.     REG_PINFLAG_B_ZERO = 0x1,
  302.  
  303.     // The filter renders this input
  304.     REG_PINFLAG_B_RENDERER = 0x2,
  305.  
  306.     // OK to create many instance of  pin
  307.     REG_PINFLAG_B_MANY = 0x4,
  308.  
  309.     // This is an Output pin
  310.     REG_PINFLAG_B_OUTPUT = 0x8
  311. };
  312.  
  313.  
  314. // describes pin for filter registration through IFilterMapper2
  315. typedef struct
  316. {
  317.     // combination of REG_PINFLAG flags
  318.     DWORD dwFlags;
  319.  
  320.     // number of instances of the pin if known
  321.     UINT             cInstances;
  322.  
  323.     UINT             nMediaTypes;
  324.     [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType;
  325.  
  326.     UINT             nMediums;
  327.     [size_is(nMediums)] const REGPINMEDIUM *lpMedium;
  328.  
  329.     // pin category (for Kernel Streaming pins) as defined in the
  330.     // Windows NT DDK
  331.     const CLSID      *clsPinCategory;
  332.  
  333. } REGFILTERPINS2;
  334.  
  335. // describes filter for registration through IFilterMapper2
  336. typedef struct
  337. {
  338.     DWORD dwVersion;            // 1 or 2
  339.     DWORD dwMerit;
  340.  
  341.     /* unnamed union */
  342.     [switch_is(dwVersion)] [switch_type(DWORD)] union
  343.     {
  344.         [case(1)]
  345.  
  346.             struct
  347.             {
  348.                 ULONG cPins;
  349.                 [size_is(cPins)] const REGFILTERPINS *rgPins;
  350.             };
  351.  
  352.         [case(2)]
  353.  
  354.             struct
  355.             {
  356.                 ULONG cPins2;
  357.                 [size_is(cPins2)] const REGFILTERPINS2 *rgPins2;
  358.             };
  359.  
  360.         [default]
  361.             ;
  362.     } ;
  363.  
  364. } REGFILTER2;
  365.  
  366.  
  367.  
  368. [
  369. object,
  370. uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375),
  371. pointer_default(unique)
  372. ]
  373. interface IFilterMapper2 : IUnknown {
  374.     import "unknwn.idl";
  375.  
  376.     // create or rename ActiveMovie category
  377.     HRESULT CreateCategory
  378.         ( [in] REFCLSID clsidCategory,
  379.           [in] DWORD dwCategoryMerit,
  380.           [in] LPCWSTR Description
  381.           );
  382.  
  383.     HRESULT UnregisterFilter
  384.         ( [in] const CLSID *pclsidCategory,
  385.           [in] const OLECHAR *szInstance,
  386.           [in] REFCLSID Filter // GUID of filter
  387.         );
  388.  
  389.     // Register a filter, pins, and media types under a category.
  390.     HRESULT RegisterFilter
  391.         ( [in] REFCLSID clsidFilter,     // GUID of the filter
  392.           [in] LPCWSTR Name,             // Descriptive name for the filter
  393.  
  394.           // ppMoniker can be null. or *ppMoniker can contain the
  395.           // moniker where this filter data will be written;
  396.           // *ppMoniker will be set to null on return. or *ppMoniker
  397.           // can be null in which case the moniker will be returned
  398.           // with refcount.
  399.           [in, out] IMoniker **ppMoniker,
  400.  
  401.           // can be null
  402.           [in] const CLSID *pclsidCategory,
  403.  
  404.           // cannot be null
  405.           [in] const OLECHAR *szInstance,
  406.  
  407.           // rest of filter and pin registration
  408.           [in] const REGFILTER2 *prf2
  409.         );
  410.  
  411.     // Set *ppEnum to be an enumerator for filters matching the
  412.     // requirements.
  413.     HRESULT EnumMatchingFilters
  414.        ( [out] IEnumMoniker **ppEnum           // enumerator returned
  415.        , [in]  DWORD dwFlags                   // 0
  416.        , [in]  BOOL bExactMatch                // don't match wildcards
  417.        , [in]  DWORD dwMerit                   // at least this merit needed
  418.        , [in]  BOOL  bInputNeeded              // need at least one input pin
  419.        , [in]  DWORD cInputTypes               // Number of input types to match
  420.                                                // Any match is OK
  421.        , [size_is(cInputTypes*2)]  const GUID *pInputTypes // input major+subtype pair array
  422.        , [in]  const REGPINMEDIUM *pMedIn      // input medium
  423.        , [in]  const CLSID *pPinCategoryIn     // input pin category
  424.        , [in]  BOOL  bRender                   // must the input be rendered?
  425.        , [in]  BOOL  bOutputNeeded             // need at least one output pin
  426.        , [in]  DWORD cOutputTypes              // Number of output types to match
  427.                                                // Any match is OK
  428.        , [size_is(cOutputTypes*2)]  const GUID *pOutputTypes // output major+subtype pair array
  429.        , [in]  const REGPINMEDIUM *pMedOut     // output medium
  430.        , [in]  const CLSID *pPinCategoryOut    // output pin category
  431.        );
  432. }
  433.  
  434. [
  435. object,
  436. uuid(b79bb0b1-33c1-11d1-abe1-00a0c905f375),
  437. pointer_default(unique)
  438. ]
  439. interface IFilterMapper3 : IFilterMapper2 {
  440.     // new interface to allow creating filters using the mapper's devenum instance
  441.     // primarily needed for out-of-proc access to a graph
  442.     HRESULT GetICreateDevEnum( [out] ICreateDevEnum **ppEnum );
  443. }
  444.  
  445. //========================================================================
  446. //========================================================================
  447. // Defines IQualityControl interface
  448. //
  449. // Defines quality messages and allows a quality manager to install itself
  450. // as the sink for quality messages.
  451. //========================================================================
  452. //========================================================================
  453.  
  454. typedef enum tagQualityMessageType {
  455.     Famine,
  456.     Flood
  457. } QualityMessageType;
  458.  
  459. typedef struct tagQuality {
  460.     QualityMessageType Type;
  461.     long                Proportion;   // milli-units.  1000 = no change
  462.                             // for Flood:
  463.                             // What proportion of the media samples currently
  464.                             // coming through are required in the future.
  465.                             // 800 means please drop another 20%
  466.                             // For Famine:
  467.                             // How much to "keep in" e.g. 800 means send me
  468.                             // 20% less e.g. by dropping 20% of the samples.
  469.                             // 1100 would mean "I'm coping, send me more".
  470.     REFERENCE_TIME       Late;
  471.                             // How much you need to catch up by
  472.     REFERENCE_TIME       TimeStamp;
  473.                             // The stream time when this was generated (probably
  474.                             // corresponds to the start time on some sample).
  475. } Quality;
  476.  
  477. typedef IQualityControl *PQUALITYCONTROL;
  478.  
  479.  
  480. [
  481. object,
  482. uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770),
  483. pointer_default(unique)
  484. ]
  485. interface IQualityControl : IUnknown {
  486.  
  487.     // Notify the recipient that a quality change is requested.
  488.     // pSelf is the IBaseFilter* of the sender.
  489.     // this is sent from a filter
  490.     // to (the quality manager or) an upstream peer.
  491.     HRESULT Notify
  492.         ( [in] IBaseFilter * pSelf,
  493.           [in] Quality q
  494.         );
  495.  
  496.     // Notify the recipient that future quality messages are to be sent
  497.     // to iqc.  If piqc is NULL then quality messages are to default back to
  498.     // the upstream peer.
  499.     // This is sent from the quality manager to a filter.
  500.     // The recipient should hold piqc as a WEAK reference,
  501.     // i.e. do not AddRef it, do not Release it.
  502.     HRESULT SetSink
  503.         ( [in] IQualityControl * piqc
  504.         );
  505. }
  506.  
  507. //=====================================================================
  508. //=====================================================================
  509. // Definitions required for overlay transport
  510. //=====================================================================
  511. //=====================================================================
  512.  
  513.  
  514. // Used to communicate the colour that the IOverlay client wants the window
  515. // painted in so that it can draw directly to the correct clipping region
  516. // A colour key can be described in two alternate ways, the first is by a
  517. // range of one or more (system) palette indices. The second is by defining
  518. // a colour cube with two RGB values, any of which would be acceptable.
  519. //
  520. // The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros
  521.  
  522.  
  523. enum { CK_NOCOLORKEY = 0x0,     // No color key is required
  524.        CK_INDEX       = 0x1,    // Index into the current system palette
  525.        CK_RGB         = 0x2 };  // Color key is an RGB value (or range)
  526.  
  527. typedef struct tagCOLORKEY {
  528.  
  529.     DWORD    KeyType;           // Explains meaning of the structure
  530.     DWORD    PaletteIndex;      // Palette index if available
  531.     COLORREF LowColorValue;     // Low colour space RGB value
  532.     COLORREF HighColorValue;    // Defines the high RGB value
  533.  
  534. } COLORKEY;
  535.  
  536. // When a filter sets up an advise link it can ask that only certain types
  537. // of notifications be sent, for example just palette changes. While this
  538. // doesn't mean that the other notification call backs won't ever be called
  539. // the IOverlay implementation may use this as an efficiency optimisation
  540.  
  541. enum { ADVISE_NONE = 0x0,               // No notifications required
  542.        ADVISE_CLIPPING = 0x1,           // Synchronous clip information
  543.        ADVISE_PALETTE = 0x2,            // Palette change notifications
  544.        ADVISE_COLORKEY = 0x4,           // Called when colour key changes
  545.        ADVISE_POSITION = 0x8,           // Likewise when window moves etc
  546.        ADVISE_DISPLAY_CHANGE = 0x10     // Called on WM_DISPLAYCHANGE
  547.      };
  548.  
  549. const DWORD ADVISE_ALL = ADVISE_CLIPPING |
  550.                          ADVISE_PALETTE |
  551.                          ADVISE_COLORKEY |
  552.                          ADVISE_POSITION;
  553.  
  554. const DWORD ADVISE_ALL2 = ADVISE_ALL |
  555.                           ADVISE_DISPLAY_CHANGE;
  556.  
  557. // This isn't defined when you run IDL
  558.  
  559. cpp_quote("#ifndef _WINGDI_")
  560.  
  561. typedef struct _RGNDATAHEADER {
  562.     DWORD dwSize;
  563.     DWORD iType;
  564.     DWORD nCount;
  565.     DWORD nRgnSize;
  566.     RECT  rcBound;
  567. } RGNDATAHEADER;
  568.  
  569. typedef struct _RGNDATA {
  570.     RGNDATAHEADER rdh;
  571.     char Buffer[1];
  572. } RGNDATA;
  573.  
  574. cpp_quote("#endif")
  575.  
  576.  
  577. //=====================================================================
  578. //=====================================================================
  579. // Defines IOverlayNotify interface
  580. //
  581. // This interface gives asynchronous notifications of changes to the
  582. // rendering window - such as changes to the exposed window area
  583. //=====================================================================
  584. //=====================================================================
  585.  
  586. [
  587. object,
  588. local,
  589. uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770),
  590. pointer_default(unique)
  591. ]
  592. interface IOverlayNotify : IUnknown {
  593.  
  594.     // IOverlayNotify methods
  595.  
  596.     // This notifies the filter of palette changes, the filter should copy
  597.     // the array of RGBQUADs if it needs to use them after returning. This
  598.     // is not called when the palette is actually changed in the display
  599.     // but at a short time after (in sync with WM_PALETTECHANGED messages)
  600.  
  601.     HRESULT OnPaletteChange(
  602.         [in] DWORD dwColors,                // Number of colours present
  603.         [in] const PALETTEENTRY *pPalette); // Array of palette colours
  604.  
  605.     // This provides synchronous clip changes so that the client is called
  606.     // before the window is moved to freeze the video, and then when the
  607.     // window has stabilised it is called again to start playback again.
  608.     // If the window rect is all zero then the window is invisible, the
  609.     // filter must take a copy of the information if it wants to keep it
  610.  
  611.     HRESULT OnClipChange(
  612.         [in] const RECT *pSourceRect,       // Region of video to use
  613.         [in] const RECT *pDestinationRect,  // Where video goes
  614.         [in] const RGNDATA *pRgnData);      // Defines clipping information
  615.  
  616.     HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey);
  617.  
  618.     // The calls to OnClipChange happen in sync with the window. So it is
  619.     // called with an empty clip list before the window moves to freeze
  620.     // the video, and then when the window has stabilised it is called
  621.     // again with the new clip list. The OnPositionChange callback is for
  622.     // overlay cards that don't want the expense of synchronous clipping
  623.     // updates and just want to know when the source or destination video
  624.     // positions change. They will NOT be called in sync with the window
  625.     // but at some point after the window has changed (basicly in time
  626.     // with WM_SIZE etc messages received). This is therefore suitable
  627.     // for overlay cards that don't inlay their data to the frame buffer
  628.     // NOTE the destination is NOT clipped to the visible display area
  629.  
  630.     HRESULT OnPositionChange([in] const RECT *pSourceRect,
  631.                              [in] const RECT *pDestinationRect);
  632. }
  633.  
  634. typedef IOverlayNotify *POVERLAYNOTIFY;
  635.  
  636.  
  637. //=====================================================================
  638. //=====================================================================
  639. // Defines IOverlayNotify2 interface
  640. //
  641. // This interface gives asynchronous notifications of changes to the
  642. // rendering window - such as changes to the exposed window area
  643. // This is optionally supported by the advise sink for the purposes
  644. // of accepting OnDisplayChange notification.
  645. //=====================================================================
  646. //=====================================================================
  647.  
  648. cpp_quote("#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)")
  649. cpp_quote("#define HMONITOR_DECLARED")
  650. cpp_quote("#if 0")
  651. typedef HANDLE HMONITOR;
  652. cpp_quote("#endif")
  653. cpp_quote("DECLARE_HANDLE(HMONITOR);")
  654. cpp_quote("#endif")
  655.  
  656. [
  657. object,
  658. local,
  659. uuid(680EFA10-D535-11D1-87C8-00A0C9223196),
  660. pointer_default(unique)
  661. ]
  662. interface IOverlayNotify2 : IOverlayNotify {
  663.  
  664.     // IOverlayNotify2 methods
  665.  
  666.     HRESULT OnDisplayChange(    // ADVISE_DISPLAY_CHANGE
  667.         HMONITOR hMonitor);
  668. }
  669.  
  670. typedef IOverlayNotify2 *POVERLAYNOTIFY2;
  671.  
  672.  
  673. //=====================================================================
  674. //=====================================================================
  675. // Defines IOverlay interface
  676. //
  677. // This interface provides information so that a filter can write direct to
  678. // the frame buffer while placing the video in the correct window position
  679. //=====================================================================
  680. //=====================================================================
  681.  
  682. [
  683. object,
  684. local,
  685. uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770),
  686. pointer_default(unique)
  687. ]
  688. interface IOverlay : IUnknown {
  689.  
  690.     // IOverlay methods
  691.  
  692.     HRESULT GetPalette(
  693.         [out] DWORD *pdwColors,              // Number of colours present
  694.         [out] PALETTEENTRY **ppPalette);     // Where to put palette data
  695.  
  696.     HRESULT SetPalette(
  697.         [in] DWORD dwColors,                 // Number of colours present
  698.         [in] PALETTEENTRY *pPalette);        // Colours to use for palette
  699.  
  700.     // If you change the colour key through SetColorKey then all the advise
  701.     // links will receive an OnColorKeyChange callback with the new colour
  702.  
  703.     HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey);
  704.     HRESULT GetColorKey([out] COLORKEY *pColorKey);
  705.     HRESULT SetColorKey([in,out] COLORKEY *pColorKey);
  706.     HRESULT GetWindowHandle([out] HWND *pHwnd);
  707.  
  708.     // The IOverlay implementation allocates the memory for the clipping
  709.     // rectangles as it can be variable in length. The filter calling
  710.     // this method should free the memory when it is finished with it
  711.  
  712.     HRESULT GetClipList([out] RECT *pSourceRect,
  713.                         [out] RECT *pDestinationRect,
  714.                         [out] RGNDATA **ppRgnData);
  715.  
  716.     // Returns the current video source and destination
  717.  
  718.     HRESULT GetVideoPosition([out] RECT *pSourceRect,
  719.                              [out] RECT *pDestinationRect);
  720.  
  721.     HRESULT Advise(
  722.         [in] IOverlayNotify *pOverlayNotify, // Notification interface
  723.         [in] DWORD dwInterests);             // Callbacks interested in
  724.  
  725.     HRESULT Unadvise();                      // Stop the callbacks now
  726. }
  727.  
  728. typedef IOverlay *POVERLAY;
  729.  
  730.  
  731. //=====================================================================
  732. //=====================================================================
  733. // control related interfaces (others are defined in control.odl)
  734. //=====================================================================
  735. //=====================================================================
  736.  
  737.  
  738. //=====================================================================
  739. //=====================================================================
  740. // Defines IMediaEventSink interface
  741. //
  742. // Exposed by filtergraph. Called by filters to notify events. Will be
  743. // passed on to application by the IMediaControl event methods.
  744. //=====================================================================
  745. //=====================================================================
  746.  
  747. [
  748.         object,
  749.         uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770),
  750.         pointer_default(unique)
  751. ]
  752. interface IMediaEventSink : IUnknown {
  753.  
  754.     // notify an event. will be queued, but not delivered to
  755.     // the application on this thread.
  756.     HRESULT Notify(
  757.         [in] long EventCode,
  758.         [in] LONG_PTR EventParam1,
  759.         [in] LONG_PTR EventParam2
  760.     );
  761. }
  762.  
  763. typedef IMediaEventSink *PMEDIAEVENTSINK;
  764.  
  765. //=====================================================================
  766. //=====================================================================
  767. // Defines IFileSourceFilter interface
  768. //
  769. // Exposed by source filters to set the file name and media type.
  770. //=====================================================================
  771. //=====================================================================
  772.  
  773. [
  774.         object,
  775.         uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770),
  776.         pointer_default(unique)
  777. ]
  778. interface IFileSourceFilter : IUnknown {
  779.  
  780.     // Load a file and assign it the given media type
  781.     HRESULT Load(
  782.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of file to open
  783.         [in, unique] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  784.     );
  785.     // Get the currently loaded file name
  786.     HRESULT GetCurFile(
  787.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  788.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  789.     );
  790. }
  791.  
  792. typedef IFileSourceFilter *PFILTERFILESOURCE;
  793.  
  794. //=====================================================================
  795. //=====================================================================
  796. // Defines IFileSinkFilter interface
  797. //
  798. // Exposed by renderers to set the output file name.
  799. //=====================================================================
  800. //=====================================================================
  801.  
  802. [
  803.         object,
  804.         uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6),
  805.         pointer_default(unique)
  806. ]
  807. interface IFileSinkFilter : IUnknown {
  808.  
  809.     // Output to this file. default is to open the existing file
  810.     HRESULT SetFileName(
  811.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of output file
  812.         [in, unique] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  813.     );
  814.     // Get the current file name
  815.     HRESULT GetCurFile(
  816.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  817.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  818.     );
  819. }
  820.  
  821. typedef IFileSinkFilter *PFILTERFILESINK;
  822.  
  823. [
  824.         object,
  825.         uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86),
  826.         pointer_default(unique)
  827. ]
  828. interface IFileSinkFilter2 : IFileSinkFilter {
  829.  
  830.     HRESULT SetMode(
  831.         [in] DWORD dwFlags              // AM_FILESINK_FLAGS
  832.     );
  833.  
  834.     HRESULT GetMode(
  835.         [out] DWORD *pdwFlags           // AM_FILESINK_FLAGS
  836.     );
  837. }
  838.  
  839. typedef IFileSinkFilter2 *PFILESINKFILTER2;
  840.  
  841. typedef enum {
  842.  
  843.     // create a new file
  844.     AM_FILE_OVERWRITE = 0x00000001,
  845.  
  846. } AM_FILESINK_FLAGS;
  847.  
  848.  
  849. //
  850. // Intelligent connectivity for filters - an interface supported by
  851. // filter graphs (since it is an extension to IFilterGraph) that supports
  852. // building of graphs by automatic selection and connection of appropriate
  853. // filters
  854.  
  855. [
  856.     object,
  857.     uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770),
  858.     pointer_default(unique)
  859. ]
  860. interface IGraphBuilder : IFilterGraph {
  861.     // Connect these two pins directly or indirectly, using transform filters
  862.     // if necessary.
  863.  
  864.     HRESULT Connect
  865.         ( [in] IPin * ppinOut,    // the output pin
  866.           [in] IPin * ppinIn      // the input pin
  867.         );
  868.  
  869.  
  870.     // Connect this output pin directly or indirectly, using transform filters
  871.     // if necessary to something that will render it.
  872.  
  873.     HRESULT Render
  874.         ( [in] IPin * ppinOut     // the output pin
  875.         );
  876.  
  877.  
  878.     // Build a filter graph that will render this file using this play list.
  879.     // If lpwstrPlayList is NULL then it will use the default play list
  880.     // which will typically render the whole file.
  881.  
  882.     HRESULT RenderFile
  883.         ( [in] LPCWSTR lpcwstrFile,
  884.           [in, unique] LPCWSTR lpcwstrPlayList
  885.         );
  886.  
  887.  
  888.     // Add to the filter graph a source filter for this file.  This would
  889.     // be the same source filter that would be added by calling Render.
  890.     // This call gives you more control over building
  891.     // the rest of the graph, e.g. AddFilter(<a renderer of your choice>)
  892.     // and then Connect the two.
  893.     // The IBaseFilter* interface exposed by the source filter is returned
  894.     // in ppFilter, addrefed already for you
  895.     // The filter will be known by the name lpcwstrFIlterName
  896.     // nn this filter graph,
  897.     HRESULT AddSourceFilter
  898.         ( [in]      LPCWSTR lpcwstrFileName,
  899.           [in, unique]      LPCWSTR lpcwstrFilterName,
  900.           [out]     IBaseFilter* *ppFilter
  901.         );
  902.  
  903.  
  904.     // If this call is made then trace information will be written to the
  905.     // file showing the actions taken in attempting to perform an operation.
  906.     HRESULT SetLogFile
  907.         ( [in]      DWORD_PTR hFile  // open file handle e.g. from CreateFile
  908.         );
  909.  
  910.  
  911.     // Request that the graph builder should return as soon as possible from
  912.     // its current task.
  913.     // Note that it is possible fot the following to occur in the following
  914.     // sequence:
  915.     //     Operation begins; Abort is requested; Operation completes normally.
  916.     // This would be normal whenever the quickest way to finish an operation
  917.     // was to simply continue to the end.
  918.     HRESULT Abort();
  919.  
  920.     // Return S_OK if the curent operation is to continue,
  921.     // return S_FALSE if the current operation is to be aborted.
  922.     // This method can be called as a callback from a filter which is doing
  923.     // some operation at the request of the graph.
  924.     HRESULT ShouldOperationContinue();
  925.  
  926. }
  927.  
  928.  
  929. //
  930. // New capture graph builder
  931.  
  932. [
  933.     object,
  934.     uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5),
  935.     pointer_default(unique)
  936. ]
  937. interface ICaptureGraphBuilder : IUnknown {
  938.  
  939.     // Use this filtergraph
  940.     HRESULT SetFiltergraph(
  941.     [in] IGraphBuilder *pfg);
  942.  
  943.     // what filtergraph are you using?
  944.     // *ppfg->Release() when you're done with it
  945.     HRESULT GetFiltergraph(
  946.     [out] IGraphBuilder **ppfg);
  947.  
  948.     // creates a rendering section in the filtergraph consisting of a MUX
  949.     // of some filetype, and a file writer (and connects them together)
  950.     // *ppf->Release() when you're done with it
  951.     // *ppSink->Release() when you're done with it
  952.     HRESULT SetOutputFileName(
  953.     [in] const GUID *pType,    // type of file to write, eg. MEDIASUBTYPE_Avi
  954.     [in] LPCOLESTR lpstrFile,    // filename given to file writer
  955.     [out] IBaseFilter **ppf,    // returns pointer to the MUX
  956.         [out] IFileSinkFilter **ppSink);// queried from file writer
  957.  
  958.     // Looks for an interface on the filter and on the output pin of the given
  959.     // category.  (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
  960.     // NULL for "don't care".
  961.     // It will also look upstream and downstream of
  962.     // the pin for the interface, to find interfaces on renderers, MUXES, TV
  963.     // Tuners, etc.
  964.     // Call *ppint->Release() when you're done with it
  965.     [local] HRESULT FindInterface(
  966.     [in, unique] const GUID *pCategory,    // can be NULL for all pins
  967.     [in] IBaseFilter *pf,
  968.     [in] REFIID riid,
  969.     [out] void **ppint);
  970.     [call_as(FindInterface)] HRESULT RemoteFindInterface(
  971.     [in, unique] const GUID *pCategory,    // can be NULL for all pins
  972.     [in] IBaseFilter *pf,
  973.     [in] REFIID riid,
  974.     [out] IUnknown **ppint);
  975.  
  976.     // Connects the pin of the given category of the source filter to the
  977.     // rendering filter, optionally through another filter (compressor?)
  978.     // For a non-NULL category, it will instantiate and connect additional
  979.     // required filters upstream too, like TV Tuners and Crossbars.
  980.     // If there is only one output pin on the source, use a NULL
  981.     // category.  You can also have pSource be a pin
  982.     HRESULT RenderStream(
  983.     [in] const GUID *pCategory,    // can be NULL if only one output pin
  984.     [in] IUnknown *pSource,        // filter or pin
  985.     [in] IBaseFilter *pfCompressor,
  986.     [in] IBaseFilter *pfRenderer);    // can be NULL
  987.  
  988.     // Sends IAMStreamControl messages to the pin of the desired category, eg.
  989.     // "capture" or "preview"
  990.     // REFERENCE_TIME=NULL means NOW
  991.     // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
  992.     // NULL controls all capture filters in the graph - you will get one
  993.     //     notification for each filter with a pin of that category found
  994.     // returns S_FALSE if stop will be signalled before last sample is
  995.     //     rendered.
  996.     // return a FAILURE code if the filter does not support IAMStreamControl
  997.     HRESULT ControlStream(
  998.     [in] const GUID *pCategory,
  999.     [in] IBaseFilter *pFilter,
  1000.     [in] REFERENCE_TIME *pstart,
  1001.     [in] REFERENCE_TIME *pstop,
  1002.     [in] WORD wStartCookie,        // high word reserved
  1003.     [in] WORD wStopCookie);        // high word reserved
  1004.  
  1005.     // creates a pre-allocated file of a given size in bytes
  1006.     HRESULT AllocCapFile(
  1007.     [in] LPCOLESTR lpstr,
  1008.     [in] DWORDLONG dwlSize);
  1009.  
  1010.     // Copies the valid file data out of the old, possibly huge old capture
  1011.     //   file into a shorter new file.
  1012.     // Return S_FALSE from your progress function to abort capture, S_OK to
  1013.     //   continue
  1014.     HRESULT CopyCaptureFile(
  1015.     [in] LPOLESTR lpwstrOld,
  1016.     [in] LPOLESTR lpwstrNew,
  1017.     [in] int fAllowEscAbort,    // pressing ESC will abort?
  1018.     [in] IAMCopyCaptureFileProgress *pCallback);    // implement this to
  1019.                             // get progress
  1020. }
  1021.  
  1022.  
  1023. //
  1024. // Capture graph builder "CopyCapturedFile" progress callback
  1025.  
  1026. [
  1027.     object,
  1028.     uuid(670d1d20-a068-11d0-b3f0-00aa003761c5),
  1029.     pointer_default(unique)
  1030. ]
  1031. interface IAMCopyCaptureFileProgress : IUnknown {
  1032.  
  1033.     // If you support this interface somewhere, this function will be called
  1034.     // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing
  1035.     // to let you know the progress
  1036.     //
  1037.     // Return S_OK from this function to continue.  Return S_FALSE to abort the
  1038.     // copy
  1039.     HRESULT Progress(
  1040.     [in] int iProgress);        // a number between 0 and 100 (%)
  1041. }
  1042.  
  1043.  
  1044. //
  1045. // Capture graph builder that can deal with a single filter having more than
  1046. // one pin of each category... some new devices can capture both audio and
  1047. // video, for example
  1048. //
  1049.  
  1050. [
  1051.     object,
  1052.     uuid(93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D),
  1053.     pointer_default(unique)
  1054. ]
  1055. interface ICaptureGraphBuilder2 : IUnknown {
  1056.  
  1057.     // Use this filtergraph
  1058.     HRESULT SetFiltergraph(
  1059.     [in] IGraphBuilder *pfg);
  1060.  
  1061.     // what filtergraph are you using?
  1062.     // *ppfg->Release() when you're done with it
  1063.     HRESULT GetFiltergraph(
  1064.     [out] IGraphBuilder **ppfg);
  1065.  
  1066.     // creates a rendering section in the filtergraph consisting of a MUX
  1067.     // of some filetype, and a file writer (and connects them together)
  1068.     // *ppf->Release() when you're done with it
  1069.     // *ppSink->Release() when you're done with it
  1070.     HRESULT SetOutputFileName(
  1071.     [in] const GUID *pType,        // GUID of MUX filter to use
  1072.     [in] LPCOLESTR lpstrFile,    // filename given to file writer
  1073.     [out] IBaseFilter **ppf,    // returns pointer to the MUX
  1074.         [out] IFileSinkFilter **ppSink);// queried from file writer
  1075.  
  1076.     // Looks for an interface on the filter and on the output pin of the given
  1077.     // category and type.  (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
  1078.     // NULL for "don't care".  Type:  MAJORTYPE_Video/Audio etc or NULL)
  1079.     // !!! Will some filters have >1 capture pin?  ie RGB and MPEG?
  1080.     // It will also look upstream and downstream of
  1081.     // the pin for the interface, to find interfaces on renderers, MUXES, TV
  1082.     // Tuners, etc.
  1083.     // Call *ppint->Release() when you're done with it
  1084.     [local] HRESULT FindInterface(
  1085.     [in] const GUID *pCategory,    // can be NULL for all pins
  1086.     [in] const GUID *pType,        // Audio/Video/??? or NULL (don't care)
  1087.     [in] IBaseFilter *pf,
  1088.     [in] REFIID riid,
  1089.     [out] void **ppint);
  1090.     [call_as(FindInterface)] HRESULT RemoteFindInterface(
  1091.     [in] const GUID *pCategory,    // can be NULL for all pins
  1092.     [in] const GUID *pType,        // Audio/Video/??? or NULL (don't care)
  1093.     [in] IBaseFilter *pf,
  1094.     [in] REFIID riid,
  1095.     [out] IUnknown **ppint);
  1096.  
  1097.     // Connects the pin of the given category and type of the source filter to
  1098.     // the rendering filter, optionally through another filter (compressor?)
  1099.     // (Type is a Majortype, like Video or Audio)
  1100.     // For a non-NULL category, it will instantiate and connect additional
  1101.     // required filters upstream too, like TV Tuners and Crossbars.
  1102.     // If there is only one output pin on the source, use a NULL category
  1103.     // and type.  You can also have pSource be a pin
  1104.     HRESULT RenderStream(
  1105.     [in] const GUID *pCategory,    // can be NULL if only one output pin
  1106.     [in] const GUID *pType,        // Major type (Video/Audio/etc)
  1107.     [in] IUnknown *pSource,        // filter or pin
  1108.     [in] IBaseFilter *pfCompressor,
  1109.     [in] IBaseFilter *pfRenderer);    // can be NULL
  1110.  
  1111.     // Sends IAMStreamControl messages to the pin of the desired category,
  1112.     // (eg. "capture" or "preview") and of the desired type (eg. VIDEO or AUDIO)
  1113.     // A category MUST be given.  If a filter is given, a type must be too.
  1114.     // REFERENCE_TIME=NULL means NOW
  1115.     // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
  1116.     // NULL controls all capture filters in the graph - you will get one
  1117.     //     notification for each filter with a pin of that category found
  1118.     // returns S_FALSE if stop will be signalled before last sample is
  1119.     //     rendered.
  1120.     // return a FAILURE code if the filter does not support IAMStreamControl
  1121.     HRESULT ControlStream(
  1122.     [in] const GUID *pCategory,
  1123.     [in] const GUID *pType,        // Major type (Video/Audio/etc)
  1124.     [in] IBaseFilter *pFilter,
  1125.     [in] REFERENCE_TIME *pstart,
  1126.     [in] REFERENCE_TIME *pstop,
  1127.     [in] WORD wStartCookie,        // high word reserved
  1128.     [in] WORD wStopCookie);        // high word reserved
  1129.  
  1130.     // creates a pre-allocated file of a given size in bytes
  1131.     HRESULT AllocCapFile(
  1132.     [in] LPCOLESTR lpstr,
  1133.     [in] DWORDLONG dwlSize);
  1134.  
  1135.     // Copies the valid file data out of the old, possibly huge old capture
  1136.     //   file into a shorter new file.
  1137.     // Return S_FALSE from your progress function to abort capture, S_OK to
  1138.     //   continue
  1139.     HRESULT CopyCaptureFile(
  1140.     [in] LPOLESTR lpwstrOld,
  1141.     [in] LPOLESTR lpwstrNew,
  1142.     [in] int fAllowEscAbort,    // pressing ESC will abort?
  1143.     [in] IAMCopyCaptureFileProgress *pCallback);    // implement this to
  1144.                             // get progress
  1145.     // Helper fn to find a certain pin on a filter.
  1146.     HRESULT FindPin(
  1147.     [in] IUnknown *pSource,
  1148.     [in] PIN_DIRECTION pindir,    // input or output?
  1149.     [in] const GUID *pCategory,    // what category? (or NULL)
  1150.     [in] const GUID *pType,        // what Major type (or NULL)
  1151.     [in] BOOL fUnconnected,        // must it be unconnected?
  1152.     [in] int num,            // which pin matching this? (0 based)
  1153.     [out] IPin **ppPin);
  1154. }
  1155.  
  1156. enum _AM_RENSDEREXFLAGS {
  1157.     AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers
  1158. };
  1159.  
  1160. //
  1161. // IFilterGraph2
  1162. //
  1163. // New methods on for IFilterGraph and IGraphBuilder will have to go here.
  1164. //
  1165.  
  1166. [
  1167.     object,
  1168.     uuid(36b73882-c2c8-11cf-8b46-00805f6cef60),
  1169.     pointer_default(unique)
  1170. ]
  1171. interface IFilterGraph2: IGraphBuilder {
  1172.  
  1173.     // Add a Moniker source moniker
  1174.     HRESULT AddSourceFilterForMoniker(
  1175.           [in] IMoniker *pMoniker,
  1176.           [in] IBindCtx *pCtx,
  1177.           [in, unique] LPCWSTR lpcwstrFilterName,
  1178.           [out] IBaseFilter **ppFilter
  1179.     );
  1180.  
  1181.     // Specify the type for a reconnect
  1182.     // This is better than Reconnect as sometime the parties to a
  1183.     // reconnection can't remember what type they'd agreed (!)
  1184.     HRESULT ReconnectEx
  1185.         ( [in] IPin * ppin,             // the pin to disconnect and reconnect
  1186.           [in, unique] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL
  1187.         );
  1188.  
  1189.     // Render a pin without adding any new renderers
  1190.     HRESULT RenderEx( [in] IPin *pPinOut,         // Pin to render
  1191.                       [in] DWORD dwFlags,         // flags
  1192.                       [in, out] DWORD *pvContext   // Unused - set to NULL
  1193.                     );
  1194.  
  1195. #if 0
  1196.     // Method looks for a filter which supports the specified interface.  If such
  1197.     // a filter exists, an AddRef()'ed pointer to the requested interface is placed
  1198.     // in *ppInterface.
  1199.     //
  1200.     // *ppInterface will be NULL on return if such a filter could not be found, and
  1201.     // the method will return E_NOINTERFACE.
  1202.     //
  1203.     // pdwIndex is an internal index that is used for obtaining subsequent interfaces.
  1204.     // *pdwIndex should be initialized to zero.  It is set on return to a value that
  1205.     // allows the implementation of FindFilterInterface to search for further interfaces
  1206.     // if called again.  If no more such interfaces exist, the method will return E_NOINTERFACE.
  1207.     //
  1208.     // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just
  1209.     // a single filter in the graph that supports the interface.  Otherwise it returns
  1210.     // E_NOINTERFACE.
  1211.     //
  1212.     HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex );
  1213.  
  1214.     // Tries to obtain the interface from the filter graph itself.  If this fails,
  1215.     // it attempts to find the unique filter that supports the interface.
  1216.     // On failure the method will return E_NOINTERFACE.  On success, it returns
  1217.     // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface.
  1218.     //
  1219.     HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface );
  1220.  
  1221. #endif
  1222. }
  1223.  
  1224. //
  1225. // StreamBuilder
  1226. // aka Graph building with constraints
  1227. // aka convergent graphs
  1228. // aka Closed captioning
  1229.  
  1230. [
  1231.     object,
  1232.     local,
  1233.     uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770),
  1234.     pointer_default(unique)
  1235. ]
  1236. interface IStreamBuilder : IUnknown {
  1237.  
  1238.     // Connect this output pin directly or indirectly, using transform filters
  1239.     // if necessary to thing(s) that will render it, within this graph
  1240.     // Move from Initial state to Rendered state.
  1241.  
  1242.     HRESULT Render
  1243.         ( [in] IPin * ppinOut,         // the output pin
  1244.           [in] IGraphBuilder * pGraph  // the graph
  1245.         );
  1246.  
  1247.     // Undo what you did in Render.  Return to Initial state.
  1248.     HRESULT Backout
  1249.         ( [in] IPin * ppinOut,         // the output pin
  1250.           [in] IGraphBuilder * pGraph  // the graph
  1251.         );
  1252. }
  1253.  
  1254.  
  1255. // async reader interface - supported by file source filters. Allows
  1256. // multiple overlapped reads from different positions
  1257.  
  1258.  
  1259. [
  1260.         object,
  1261.         uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770),
  1262.         pointer_default(unique)
  1263. ]
  1264. interface IAsyncReader : IUnknown
  1265. {
  1266.     // pass in your preferred allocator and your preferred properties.
  1267.     // method returns the actual allocator to be used. Call GetProperties
  1268.     // on returned allocator to learn alignment and prefix etc chosen.
  1269.     // this allocator will be not be committed and decommitted by
  1270.     // the async reader, only by the consumer.
  1271.     // Must call this before calling Request.
  1272.     HRESULT RequestAllocator(
  1273.                 [in]  IMemAllocator* pPreferred,
  1274.                 [in]  ALLOCATOR_PROPERTIES* pProps,
  1275.                 [out] IMemAllocator ** ppActual);
  1276.  
  1277.     // queue a request for data.
  1278.     // media sample start and stop times contain the requested absolute
  1279.     // byte position (start inclusive, stop exclusive).
  1280.     // may fail if sample not obtained from agreed allocator.
  1281.     // may fail if start/stop position does not match agreed alignment.
  1282.     // samples allocated from source pin's allocator may fail
  1283.     // GetPointer until after returning from WaitForNext.
  1284.     // Stop position must be aligned - this means it may exceed duration.
  1285.     // on completion, stop position will be corrected to unaligned
  1286.     // actual data.
  1287.     HRESULT Request(
  1288.                 [in] IMediaSample* pSample,
  1289.                 [in] DWORD_PTR dwUser);            // user context
  1290.  
  1291.     // block until the next sample is completed or the timeout occurs.
  1292.     // timeout (millisecs) may be 0 or INFINITE. Samples may not
  1293.     // be delivered in order. If there is a read error of any sort, a
  1294.     // notification will already have been sent by the source filter,
  1295.     // and HRESULT will be an error.
  1296.     // If ppSample is not null, then a Request completed with the result
  1297.     // code returned.
  1298.     HRESULT WaitForNext(
  1299.                 [in]  DWORD dwTimeout,
  1300.                 [out] IMediaSample** ppSample,  // completed sample
  1301.                 [out] DWORD_PTR * pdwUser);        // user context
  1302.  
  1303.     // sync read of data. Sample passed in must have been acquired from
  1304.     // the agreed allocator. Start and stop position must be aligned.
  1305.     // equivalent to a Request/WaitForNext pair, but may avoid the
  1306.     // need for a thread on the source filter.
  1307.     HRESULT SyncReadAligned(
  1308.                 [in] IMediaSample* pSample);
  1309.  
  1310.  
  1311.     // sync read. works in stopped state as well as run state.
  1312.     // need not be aligned. Will fail if read is beyond actual total
  1313.     // length.
  1314.     HRESULT SyncRead(
  1315.                 [in]  LONGLONG llPosition,    // absolute file position
  1316.                 [in]  LONG lLength,        // nr bytes required
  1317.                 [out, size_is(lLength)]
  1318.               BYTE* pBuffer);        // write data here
  1319.  
  1320.     // return total length of stream, and currently available length.
  1321.     // reads for beyond the available length but within the total length will
  1322.     // normally succeed but may block for a long period.
  1323.     HRESULT Length(
  1324.                 [out] LONGLONG* pTotal,
  1325.                 [out] LONGLONG* pAvailable);
  1326.  
  1327.     // cause all outstanding reads to return, possibly with a failure code
  1328.     //(VFW_E_TIMEOUT) indicating they were cancelled.
  1329.     // Between BeginFlush and EndFlush calls, Request calls will fail and
  1330.     // WaitForNext calls will always complete immediately.
  1331.     HRESULT BeginFlush(void);
  1332.     HRESULT EndFlush(void);
  1333. }
  1334.  
  1335.  
  1336. // interface provided by the filtergraph itself to let other objects
  1337. // (especially plug-in distributors, but also apps like graphedt) know
  1338. // when the graph has changed.
  1339. [
  1340.     object,
  1341.     uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770),
  1342.     pointer_default(unique)
  1343. ]
  1344. interface IGraphVersion : IUnknown
  1345. {
  1346.     // returns the current graph version number
  1347.     // this is incremented every time there is a change in the
  1348.     // set of filters in the graph or in their connections
  1349.     //
  1350.     // if this is changed since your last enumeration, then re-enumerate
  1351.     // the graph
  1352.     HRESULT QueryVersion(LONG* pVersion);
  1353. }
  1354.  
  1355.  
  1356.  
  1357.  
  1358. //
  1359. // interface describing an object that uses resources.
  1360. //
  1361. // implement if: you request resources using IResourceManager. You will
  1362. // need to pass your implementation of this pointer as an in param.
  1363. //
  1364. // use if: you are a resource manager who implements IResourceManager
  1365. [
  1366.     object,
  1367.     uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770),
  1368.     pointer_default(unique)
  1369. ]
  1370. interface IResourceConsumer : IUnknown
  1371. {
  1372.     // you may acquire the resource specified.
  1373.     // return values:
  1374.     //      S_OK    -- I have successfully acquired it
  1375.     //      S_FALSE -- I will acquire it and call NotifyAcquire afterwards
  1376.     //      VFW_S_NOT_NEEDED: I no longer need the resource
  1377.     //      FAILED(hr)-I tried to acquire it and failed.
  1378.  
  1379.     HRESULT
  1380.     AcquireResource(
  1381.         [in] LONG idResource);
  1382.  
  1383.  
  1384.  
  1385.     // Please release the resource.
  1386.     // return values:
  1387.     //      S_OK    -- I have released it (and want it again when available)
  1388.     //      S_FALSE -- I will call NotifyRelease when I have released it
  1389.     //      other   something went wrong.
  1390.     HRESULT
  1391.     ReleaseResource(
  1392.         [in] LONG idResource);
  1393. }
  1394.  
  1395.  
  1396.  
  1397. // interface describing a resource manager that will resolve contention for
  1398. // named resources.
  1399. //
  1400. // implement if: you are a resource manager. The filtergraph will be a resource
  1401. // manager, internally delegating to the system wide resource manager
  1402. // (when there is one)
  1403. //
  1404. // use if: you need resources that are limited. Use the resource manager to
  1405. // resolve contention by registering the resource with this interface,
  1406. // and requesting it from this interface whenever needed.
  1407. //
  1408. // or use if: you detect focus changes which should affect resource usage.
  1409. // Notifying change of focus to the resource manager will cause the resource
  1410. // manager to switch contended resources to the objects that have the user's
  1411. // focus
  1412. [
  1413.     object,
  1414.     uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770),
  1415.     pointer_default(unique)
  1416. ]
  1417. interface IResourceManager : IUnknown
  1418. {
  1419.     // tell the manager how many there are of a resource.
  1420.     // ok if already registered. will take new count. if new count
  1421.     // is lower, will de-allocate resources to new count.
  1422.     //
  1423.     // You get back a token that will be used in further calls.
  1424.     //
  1425.     // Passing a count of 0 will eliminate this resource. There is currently
  1426.     // no defined way to find the id without knowing the count.
  1427.     //
  1428.     HRESULT
  1429.     Register(
  1430.         [in] LPCWSTR pName,         // this named resource
  1431.         [in] LONG   cResource,      // has this many instances
  1432.         [out] LONG* plToken         // token placed here on return
  1433.         );
  1434.  
  1435.     HRESULT
  1436.     RegisterGroup(
  1437.         [in] LPCWSTR pName,         // this named resource group
  1438.         [in] LONG cResource,        // has this many resources
  1439.         [in, size_is(cResource)]
  1440.              LONG* palTokens,      // these are the contained resources
  1441.         [out] LONG* plToken        // group resource id put here on return
  1442.         );
  1443.  
  1444.     // request the use of a given, registered resource.
  1445.     // possible return values:
  1446.     //      S_OK == yes you can use it now
  1447.     //      S_FALSE == you will be called back when the resource is available
  1448.     //      other - there is an error.
  1449.     //
  1450.     // The priority of this request should be affected by the associated
  1451.     // focus object -- that is, when SetFocus is called for that focus
  1452.     // object (or a 'related' object) then my request should be put through.
  1453.     //
  1454.     // A filter should pass the filter's IUnknown here. The filtergraph
  1455.     // will match filters to the filtergraph, and will attempt to trace
  1456.     // filters to common source filters when checking focus objects.
  1457.     // The Focus object must be valid for the entire lifetime of the request
  1458.     // -- until you call CancelRequest or NotifyRelease(id, p, FALSE)
  1459.     HRESULT
  1460.     RequestResource(
  1461.         [in] LONG idResource,
  1462.         [in] IUnknown* pFocusObject,
  1463.         [in] IResourceConsumer* pConsumer
  1464.         );
  1465.  
  1466.  
  1467.     // notify the resource manager that an acquisition attempt completed.
  1468.     // Call this method after an AcquireResource method returned
  1469.     // S_FALSE to indicate asynchronous acquisition.
  1470.     // HR should be S_OK if the resource was successfully acquired, or a
  1471.     // failure code if the resource could not be acquired.
  1472.     HRESULT
  1473.     NotifyAcquire(
  1474.         [in] LONG idResource,
  1475.         [in] IResourceConsumer* pConsumer,
  1476.         [in] HRESULT hr);
  1477.  
  1478.     // Notify the resource manager that you have released a resource. Call
  1479.     // this in response to a ReleaseResource method, or when you have finished
  1480.     // with the resource. bStillWant should be TRUE if you still want the
  1481.     // resource when it is next available, or FALSE if you no longer want
  1482.     // the resource.
  1483.     HRESULT
  1484.     NotifyRelease(
  1485.         [in] LONG idResource,
  1486.         [in] IResourceConsumer* pConsumer,
  1487.         [in] BOOL bStillWant);
  1488.  
  1489.     // I don't currently have the resource, and I no longer need it.
  1490.     HRESULT
  1491.     CancelRequest(
  1492.         [in] LONG idResource,
  1493.         [in] IResourceConsumer* pConsumer);
  1494.  
  1495.     // Notify the resource manager that a given object has been given the
  1496.     // user's focus. In ActiveMovie, this will normally be a video renderer
  1497.     // whose window has received the focus. The filter graph will switch
  1498.     // contended resources to (in order):
  1499.     //      requests made with this same focus object
  1500.     //      requests whose focus object shares a common source with this
  1501.     //      requests whose focus object shares a common filter graph
  1502.     // After calling this, you *must* call ReleaseFocus before the IUnknown
  1503.     // becomes invalid, unless you can guarantee that another SetFocus
  1504.     // of a different object is done in the meantime. No addref is held.
  1505.     //
  1506.     // The resource manager will hold this pointer until replaced or cancelled,
  1507.     // and will use it to resolve resource contention. It will call
  1508.     // QueryInterface for IBaseFilter at least and if found will call methods on
  1509.     // that interface.
  1510.     HRESULT
  1511.     SetFocus(
  1512.         [in] IUnknown* pFocusObject);
  1513.  
  1514.     // Sets the focus to NULL if the current focus object is still
  1515.     // pFocusObject. Call this when
  1516.     // the focus object is about to be destroyed to ensure that no-one is
  1517.     // still referencing the object.
  1518.     HRESULT
  1519.     ReleaseFocus(
  1520.         [in] IUnknown* pFocusObject);
  1521.  
  1522.  
  1523.  
  1524. // !!! still need
  1525. //      -- app override (some form of SetPriority)
  1526. //      -- enumeration and description of resources
  1527.  
  1528. }
  1529.  
  1530.  
  1531. //
  1532. // Interface representing an object that can be notified about state
  1533. // and other changes within a filter graph. The filtergraph will call plug-in
  1534. // distributors that expose this optional interface so that they can
  1535. // respond to appropriate changes.
  1536. //
  1537. // Implement if: you are a plug-in distributor (your class id is found
  1538. // under HKCR\Interface\<IID>\Distributor= for some interface).
  1539. //
  1540. // Use if: you are the filtergraph.
  1541. [
  1542.     object,
  1543.     uuid(56a868af-0ad4-11ce-b03a-0020af0ba770),
  1544.     pointer_default(unique)
  1545. ]
  1546. interface IDistributorNotify : IUnknown
  1547. {
  1548.     // called when graph is entering stop state. Called before
  1549.     // filters are stopped.
  1550.     HRESULT Stop(void);
  1551.  
  1552.     // called when graph is entering paused state, before filters are
  1553.     // notified
  1554.     HRESULT Pause(void);
  1555.  
  1556.     // called when graph is entering running state, before filters are
  1557.     // notified. tStart is the stream-time offset parameter that will be
  1558.     // given to each filter's IBaseFilter::Run method.
  1559.     HRESULT Run(REFERENCE_TIME tStart);
  1560.  
  1561.     // called when the graph's clock is changing, with the new clock. Addref
  1562.     // the clock if you hold it beyond this method. Called before
  1563.     // the filters are notified.
  1564.     HRESULT SetSyncSource(
  1565.         [in] IReferenceClock * pClock);
  1566.  
  1567.     // called when the set of filters or their connections has changed.
  1568.     // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything
  1569.     // that will lead to one of these).
  1570.     // You don't need to rebuild your list of interesting filters at this point
  1571.     // but you should release any refcounts you hold on any filters that
  1572.     // have been removed.
  1573.     HRESULT NotifyGraphChange(void);
  1574. }
  1575.  
  1576. typedef enum {
  1577.     AM_STREAM_INFO_START_DEFINED = 0x00000001,
  1578.     AM_STREAM_INFO_STOP_DEFINED  = 0x00000002,
  1579.     AM_STREAM_INFO_DISCARDING    = 0x00000004,
  1580.     AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010
  1581. } AM_STREAM_INFO_FLAGS;
  1582.  
  1583. //  Stream information
  1584. typedef struct {
  1585.     REFERENCE_TIME tStart;
  1586.     REFERENCE_TIME tStop;
  1587.     DWORD dwStartCookie;
  1588.     DWORD dwStopCookie;
  1589.     DWORD dwFlags;
  1590. } AM_STREAM_INFO;
  1591.  
  1592. //
  1593. // IAMStreamControl
  1594. //
  1595.  
  1596. [
  1597.     object,
  1598.     uuid(36b73881-c2c8-11cf-8b46-00805f6cef60),
  1599.     pointer_default(unique)
  1600. ]
  1601. interface IAMStreamControl : IUnknown
  1602. {
  1603.     // The REFERENCE_TIME pointers may be null, which
  1604.     // indicates immediately.  If the pointer is non-NULL
  1605.     // and dwCookie is non-zero, then pins should send
  1606.     // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED
  1607.     // with an IPin pointer and the cookie, thus allowing
  1608.     // apps to tie the events back to their requests.
  1609.     // If either dwCookies is zero, or the pointer is null,
  1610.     // then no event is sent.
  1611.  
  1612.     // If you have a capture pin hooked up to a MUX input pin and they
  1613.     // both support IAMStreamControl, you'll want the MUX to signal the
  1614.     // stop so you know the last frame was written out.  In order for the
  1615.     // MUX to know it's finished, the capture pin will have to send one
  1616.     // extra sample after it was supposed to stop, so the MUX can trigger
  1617.     // off that.  So you would set bSendExtra to TRUE for the capture pin
  1618.     // Leave it FALSE in all other cases.
  1619.  
  1620.     HRESULT StartAt( [in] const REFERENCE_TIME * ptStart,
  1621.                      [in] DWORD dwCookie );
  1622.     HRESULT StopAt(  [in] const REFERENCE_TIME * ptStop,
  1623.                      [in] BOOL bSendExtra,
  1624.                      [in] DWORD dwCookie );
  1625.     HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo);
  1626. }
  1627.  
  1628.  
  1629.  
  1630. //
  1631. // ISeekingPassThru
  1632. //
  1633.  
  1634. [
  1635.     object,
  1636.     uuid(36b73883-c2c8-11cf-8b46-00805f6cef60),
  1637.     pointer_default(unique)
  1638. ]
  1639. interface ISeekingPassThru : IUnknown
  1640. {
  1641.     HRESULT Init(  [in] BOOL bSupportRendering,
  1642.                    [in] IPin *pPin);
  1643. }
  1644.  
  1645.  
  1646.  
  1647. //
  1648. // IAMStreamConfig - pin interface
  1649. //
  1650.  
  1651. // A capture filter or compression filter's output pin
  1652. // supports this interface - no matter what data type you produce.
  1653.  
  1654. // This interface can be used to set the output format of a pin (as an
  1655. // alternative to connecting the pin using a specific media type).
  1656. // After setting an output format, the pin will use that format
  1657. // the next time it connects to somebody, so you can just Render that
  1658. // pin and get a desired format without using Connect(CMediaType)
  1659. // Your pin should do that by ONLY OFFERING the media type set in SetFormat
  1660. // in its enumeration of media types, and no others.  This will ensure that
  1661. // that format is indeed used for connection (or at least offer it first).
  1662. // An application interested in enumerating accepted mediatypes may have to
  1663. // do so BEFORE calling SetFormat.
  1664.  
  1665. // But this interface's GetStreamCaps function can get more information
  1666. // about accepted media types than the traditional way of enumerating a pin's
  1667. // media types, so it should typically be used instead.
  1668. // GetStreamCaps gets information about the kinds of formats allowed... how
  1669. // it can stretch and crop, and the frame rate and data rates allowed (for
  1670. // video)
  1671.  
  1672. // VIDEO EXAMPLE
  1673. //
  1674. // GetStreamCaps returns a whole array of {MediaType, Capabilities}.
  1675. // Let's say your capture card supports JPEG anywhere between 160x120 and
  1676. // 320x240, and also the size 640x480.  Also, say it supports RGB24 at
  1677. // resolutions between 160x120 and 320x240 but only multiples of 8.  You would
  1678. // expose these properties by offering a media type of 320 x 240 JPEG
  1679. // (if that is your default or preferred size) coupled with
  1680. // capabilities saying minimum 160x120 and maximum 320x240 with granularity of
  1681. // 1.  The next pair you expose is a media type of 640x480 JPEG coupled with
  1682. // capabilities of min 640x480 max 640x480.  The third pair is media type
  1683. // 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8.
  1684. // In this way you can expose almost every quirk your card might have.
  1685. // An application interested in knowing what compression formats you provide
  1686. // can get all the pairs and make a list of all the unique sub types of the
  1687. // media types.
  1688. //
  1689. // If a filter's output pin is connected with a media type that has rcSource
  1690. // and rcTarget not empty, it means the filter is being asked to stretch the
  1691. // rcSource sub-rectangle of its InputSize (the format of the input pin for
  1692. // a compressor, and the largest bitmap a capture filter can generate with
  1693. // every pixel unique) into the rcTarget sub-rectangle of its output format.
  1694. // For instance, if a video compressor has as input 160x120 RGB, and as output
  1695. // 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100)
  1696. // this means the compressor is being asked to take a 10x10 piece of the 160x120
  1697. // RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap,
  1698. // leaving the rest of the 320x240 bitmap untouched.
  1699. // A filter does not have to support this and can fail to connect with a
  1700. // media type where rcSource and rcTarget are not empty.
  1701. //
  1702. // Your output pin is connected to the next filter with a certain media
  1703. // type (either directly or using the media type passed by SetFormat),
  1704. // and you need to look at the AvgBytesPerSecond field of the format
  1705. // of that mediatype to see what data rate you are being asked to compress
  1706. // the video to, and use that data rate.  Using the number of frames per
  1707. // second in AvgTimePerFrame, you can figure out how many bytes each frame
  1708. // is supposed to be.  You can make it smaller, but NEVER EVER make a bigger
  1709. // data rate.  For a video compressor, your input pin's media type tells you
  1710. // the frame rate (use that AvgTimePerFrame).  For a capture filter, the
  1711. // output media type tells you, so use that AvgTimePerFrame.
  1712. //
  1713. // The cropping rectangle described below is the same as the rcSrc of the
  1714. // output pin's media type.
  1715. //
  1716. // The output rectangle described below is the same of the width and height
  1717. // of the BITMAPINFOHEADER of the media type of the output pin's media type
  1718.  
  1719.  
  1720. // AUDIO EXAMPLE
  1721. //
  1722. // This API can return an array of pairs of (media type, capabilities).
  1723. // This can be used to expose all kinds of wierd capabilities.  Let's say you
  1724. // do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or
  1725. // stereo, and you also do 48,000 16bit stereo as a special combination.
  1726. // You would expose 3 pairs.  The first pair would have Min Freq of 11025 and
  1727. // Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the
  1728. // capabilites structure, and a media type of anything you like, maybe
  1729. // 22kHz, 8bit stereo as a default.
  1730. // The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in
  1731. // the capabilities structure and the media type could be something like
  1732. // 44kHz, 16bit stereo as a default (the media type in the pair should always
  1733. // be something legal as described by the capabilities structure... the
  1734. // structure tells you how you can change the media type to produce other
  1735. // legal media types... for instance changing 44kHz to 29010Hz would be legal,
  1736. // but changing bits from 16 to 14 would not be.)
  1737. // The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2
  1738. // MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo.
  1739. // You can also use the Granularity elements of the structure (like the example
  1740. // for video) if you support values that multiples of n, eg.  you could say
  1741. // minimum bits per sample 8, max 16, and granularity 8 to describe doing
  1742. // either 8 or 16 bit all in one structure
  1743. //
  1744. // If you support non-PCM formats, the media type returned in GetStreamCaps
  1745. // can show which non-PCM formats you support (with a default sample rate,
  1746. // bit rate and channels) and the capabilities structure going with that
  1747. // media type can describe which other sample rates, bit rates and channels
  1748. // you support.
  1749.  
  1750. [
  1751.     object,
  1752.     uuid(C6E13340-30AC-11d0-A18C-00A0C9118956),
  1753.     pointer_default(unique)
  1754. ]
  1755. interface IAMStreamConfig : IUnknown
  1756. {
  1757.  
  1758.     // this is the structure returned by a VIDEO filter
  1759.     //
  1760.     typedef struct _VIDEO_STREAM_CONFIG_CAPS {
  1761.  
  1762.     GUID        guid;    // will be MEDIATYPE_Video
  1763.  
  1764.     // the logical or of all the AnalogVideoStandard's supported
  1765.     // typically zero if not supported
  1766.     ULONG        VideoStandard;
  1767.  
  1768.     // the inherent size of the incoming signal... taken from the input
  1769.     // pin for a compressor, or the largest size a capture filter can
  1770.     // digitize the signal with every pixel still unique
  1771.         SIZE        InputSize;
  1772.  
  1773.     // The input of a compressor filter may have to be connected for these
  1774.     // to be known
  1775.  
  1776.     // smallest rcSrc cropping rect allowed
  1777.         SIZE        MinCroppingSize;
  1778.     // largest rcSrc cropping rect allowed
  1779.         SIZE        MaxCroppingSize;
  1780.     // granularity of cropping size - eg only widths a multiple of 4 allowed
  1781.         int         CropGranularityX;
  1782.         int         CropGranularityY;
  1783.     // alignment of cropping rect - eg rect must start on multiple of 4
  1784.     int        CropAlignX;
  1785.     int        CropAlignY;
  1786.  
  1787.     // The input of a compressor filter may have to be connected for these
  1788.     // to be known
  1789.  
  1790.     // smallest bitmap this pin can produce
  1791.         SIZE        MinOutputSize;
  1792.     // largest bitmap this pin can produce
  1793.         SIZE        MaxOutputSize;
  1794.     // granularity of output bitmap size
  1795.         int         OutputGranularityX;
  1796.         int         OutputGranularityY;
  1797.     // !!! what about alignment of rcTarget inside BIH if different?
  1798.  
  1799.     // how well can you stretch in the x direction?  0==not at all
  1800.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1801.     // etc.
  1802.     int        StretchTapsX;
  1803.     int        StretchTapsY;
  1804.     // how well can you shrink in the x direction?  0==not at all
  1805.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1806.     // etc.
  1807.     int        ShrinkTapsX;
  1808.     int        ShrinkTapsY;
  1809.  
  1810.     // CAPTURE filter only - what frame rates are allowed?
  1811.         LONGLONG    MinFrameInterval;
  1812.         LONGLONG    MaxFrameInterval;
  1813.  
  1814.     // what data rates can this pin produce?
  1815.         LONG        MinBitsPerSecond;
  1816.         LONG        MaxBitsPerSecond;
  1817.     } VIDEO_STREAM_CONFIG_CAPS;
  1818.  
  1819.  
  1820.     // this is the structure returned by an AUDIO filter
  1821.     //
  1822.     typedef struct _AUDIO_STREAM_CONFIG_CAPS {
  1823.  
  1824.       GUID       guid;    // will be MEDIATYPE_Audio
  1825.     ULONG        MinimumChannels;
  1826.        ULONG      MaximumChannels;
  1827.     ULONG      ChannelsGranularity;
  1828.        ULONG      MinimumBitsPerSample;
  1829.        ULONG      MaximumBitsPerSample;
  1830.     ULONG      BitsPerSampleGranularity;
  1831.        ULONG      MinimumSampleFrequency;
  1832.        ULONG      MaximumSampleFrequency;
  1833.     ULONG      SampleFrequencyGranularity;
  1834.     } AUDIO_STREAM_CONFIG_CAPS;
  1835.  
  1836.     // - only allowed when pin is not streaming, else the call will FAIL
  1837.     // - If your output pin is not yet connected, and you can
  1838.     //   connect your output pin with this media type, you should
  1839.     //   succeed the call, and start offering it first (enumerate as format#0)
  1840.     //   from GetMediaType so that this format will be used to connect with
  1841.     //   when you do connect to somebody
  1842.     // - if your output pin is already connected, and you can provide this
  1843.     //   type, reconnect your pin.  If the other pin can't accept it, FAIL
  1844.     //   this call and leave your connection alone.
  1845.     HRESULT SetFormat(
  1846.             [in] AM_MEDIA_TYPE *pmt);
  1847.  
  1848.     // the format it's connected with, or will connect with
  1849.     // the application is responsible for calling DeleteMediaType(*ppmt);
  1850.     HRESULT GetFormat(
  1851.             [out] AM_MEDIA_TYPE **ppmt);
  1852.  
  1853.     // how many different Stream Caps structures are there?
  1854.     // also, how big is the stream caps structure?
  1855.     HRESULT GetNumberOfCapabilities(
  1856.             [out] int *piCount,
  1857.         [out] int *piSize);    // pSCC of GetStreamCaps needs to be this big
  1858.  
  1859.     // - gets one of the pairs of {Mediatype, Caps}
  1860.     // - return S_FALSE if iIndex is too high
  1861.     // - the application is responsible for calling DeleteMediaType(*ppmt);
  1862.     // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video
  1863.     //   or MEDIATYPE_Audio, so you can tell if you have a pointer to a
  1864.     //   VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure
  1865.     //   There could potentially be many more possibilities other than video
  1866.     //   or audio.
  1867.     HRESULT GetStreamCaps(
  1868.         [in]  int iIndex,    // 0 to #caps-1
  1869.         [out] AM_MEDIA_TYPE **ppmt,
  1870.             [out] BYTE *pSCC);
  1871.  
  1872. }
  1873.  
  1874.  
  1875.  
  1876. // Interface to control interleaving of different streams in one file
  1877. [
  1878. object,
  1879. uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86),
  1880. pointer_default(unique)
  1881. ]
  1882. interface IConfigInterleaving : IUnknown
  1883. {
  1884.     import "unknwn.idl";
  1885.  
  1886.     typedef enum
  1887.     {
  1888.         // uninterleaved - samples written out in the order they
  1889.         // arrive.
  1890.         INTERLEAVE_NONE,
  1891.  
  1892.         // approximate interleaving with less overhead for video
  1893.         // capture
  1894.         INTERLEAVE_CAPTURE,
  1895.  
  1896.         // full, precise interleaving. slower.
  1897.         INTERLEAVE_FULL,
  1898.  
  1899.         // samples written out in the order they arrive. writes are
  1900.         // buffered
  1901.         INTERLEAVE_NONE_BUFFERED
  1902.  
  1903.     } InterleavingMode;
  1904.  
  1905.     HRESULT put_Mode(
  1906.         [in] InterleavingMode mode
  1907.         );
  1908.  
  1909.     HRESULT get_Mode(
  1910.         [out] InterleavingMode *pMode
  1911.         );
  1912.  
  1913.     HRESULT put_Interleaving(
  1914.         [in] const REFERENCE_TIME *prtInterleave,
  1915.         [in] const REFERENCE_TIME *prtPreroll
  1916.         );
  1917.  
  1918.     HRESULT get_Interleaving(
  1919.         [out] REFERENCE_TIME *prtInterleave,
  1920.         [out] REFERENCE_TIME *prtPreroll
  1921.         );
  1922. }
  1923.  
  1924. // Interface to control the AVI mux
  1925. [
  1926. object,
  1927. uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6),
  1928. pointer_default(unique)
  1929. ]
  1930. interface IConfigAviMux : IUnknown
  1931. {
  1932.     import "unknwn.idl";
  1933.  
  1934.     // control whether the AVI mux adjusts the frame rate or audio
  1935.     // sampling rate for drift when the file is closed. -1 to disables
  1936.     // this behavior.
  1937.     HRESULT SetMasterStream([in] LONG iStream);
  1938.     HRESULT GetMasterStream([out] LONG *pStream);
  1939.  
  1940.     // control whether the AVI mux writes out an idx1 index chunk for
  1941.     // compatibility with older AVI players.
  1942.     HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex);
  1943.     HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex);
  1944. }
  1945.  
  1946.     //---------------------------------------------------------------------
  1947.     //  CompressionCaps enum
  1948.     //---------------------------------------------------------------------
  1949.  
  1950.     // This tells you which features of IAMVideoCompression are supported
  1951.  
  1952.     // CanCrunch means that it can compress video to a specified data rate
  1953.     // If so, then the output pin's media type will contain that data rate
  1954.     // in the format's AvgBytesPerSecond field, and that should be used.
  1955.  
  1956.     typedef enum
  1957.     {
  1958.         CompressionCaps_CanQuality =  0x01,
  1959.         CompressionCaps_CanCrunch =   0x02,
  1960.         CompressionCaps_CanKeyFrame = 0x04,
  1961.         CompressionCaps_CanBFrame =   0x08,
  1962.         CompressionCaps_CanWindow =   0x10
  1963.     } CompressionCaps;
  1964.  
  1965.  
  1966.  
  1967.     //---------------------------------------------------------------------
  1968.     // IAMVideoCompression interface
  1969.     //
  1970.     // Control compression parameters - pin interface
  1971.     //---------------------------------------------------------------------
  1972.  
  1973.     // This interface is implemented by the output pin of a video capture
  1974.     // filter or video compressor that provides video data
  1975.  
  1976.     // You use this interface to control how video is compressed... how
  1977.     // many keyframes, etc., and to find information like capabilities and
  1978.     // the description of this compressor
  1979.  
  1980.     [
  1981.     object,
  1982.         uuid(C6E13343-30AC-11d0-A18C-00A0C9118956),
  1983.         pointer_default(unique)
  1984.     ]
  1985.     interface IAMVideoCompression : IUnknown
  1986.     {
  1987.     // - Only valid if GetInfo's pCapabilities sets
  1988.     //   CompressionCaps_CanKeyFrame
  1989.         // - KeyFrameRate < 0 means use the compressor default
  1990.     // - KeyFrames == 0 means only the first frame is a key
  1991.         HRESULT put_KeyFrameRate (
  1992.                     [in] long KeyFrameRate);
  1993.  
  1994.         HRESULT get_KeyFrameRate (
  1995.                     [out] long * pKeyFrameRate);
  1996.  
  1997.     // - Only valid if GetInfo's pCapabilities sets
  1998.     //   CompressionCaps_CanBFrame
  1999.     // - If keyframes are every 10, and there are 3 P Frames per key,
  2000.     //   they will be spaced evenly between the key frames and the other
  2001.     //   6 frames will be B frames
  2002.     // - PFramesPerKeyFrame < 0 means use the compressor default
  2003.         HRESULT put_PFramesPerKeyFrame (
  2004.                     [in] long PFramesPerKeyFrame);
  2005.  
  2006.         HRESULT get_PFramesPerKeyFrame (
  2007.                     [out] long * pPFramesPerKeyFrame);
  2008.  
  2009.     // - Only valid if GetInfo's pCapabilities sets
  2010.     //   CompressionCaps_CanQuality
  2011.     // - Controls image quality
  2012.     // - If you are compressing to a fixed data rate, a high quality
  2013.     //   means try and use all of the data rate, and a low quality means
  2014.     //   feel free to use much lower than the data rate if you want to.
  2015.         // - Quality < 0 means use the compressor default
  2016.         HRESULT put_Quality (
  2017.                     [in] double Quality);
  2018.  
  2019.         HRESULT get_Quality (
  2020.                     [out] double * pQuality);
  2021.  
  2022.     // If you have set a data rate of 100K/sec on a 10fps movie, that
  2023.     // will normally mean each frame must be <=10K.  But a window size
  2024.     // means every consecutive n frames must average to the data rate,
  2025.     // but an individual frame (if n > 1) is allowed to exceed the
  2026.     // frame size suggested by the data rate
  2027.         HRESULT put_WindowSize (
  2028.                     [in] DWORDLONG WindowSize);
  2029.  
  2030.         HRESULT get_WindowSize (
  2031.                     [out] DWORDLONG * pWindowSize);
  2032.  
  2033.     // - pszVersion might be "Version 2.1.0"
  2034.     // - pszDescription might be "Danny's awesome video compressor"
  2035.     // - pcbVersion and pcbDescription will be filled in with the
  2036.     //   required length if they are too short
  2037.     // - *pCapabilities is a logical OR of some CompressionCaps flags
  2038.         HRESULT GetInfo(
  2039.                     [out, size_is(*pcbVersion)] WCHAR * pszVersion,
  2040.                     [in,out] int *pcbVersion,
  2041.                     [out, size_is(*pcbDescription)] LPWSTR pszDescription,
  2042.                     [in,out] int *pcbDescription,
  2043.             [out] long *pDefaultKeyFrameRate,
  2044.             [out] long *pDefaultPFramesPerKey,
  2045.             [out] double *pDefaultQuality,
  2046.                     [out] long *pCapabilities  //CompressionCaps
  2047.         );
  2048.  
  2049.     // - this means when this frame number comes along after the graph
  2050.     //   is running, make it a keyframe even if you weren't going to
  2051.         HRESULT OverrideKeyFrame(
  2052.                     [in]  long FrameNumber
  2053.         );
  2054.  
  2055.     // - Only valid if GetInfo's pCapabilities sets
  2056.     //   CompressionCaps_CanCrunch
  2057.     // - this means when this frame number comes along after the graph
  2058.     //   is running, make it this many bytes big instead of whatever size
  2059.     //   you were going to make it.
  2060.         HRESULT OverrideFrameSize(
  2061.                     [in]  long FrameNumber,
  2062.                     [in]  long Size
  2063.         );
  2064.  
  2065.     }
  2066.  
  2067.     //---------------------------------------------------------------------
  2068.     //  VfwCaptureDialogs enum
  2069.     //---------------------------------------------------------------------
  2070.  
  2071.     typedef enum
  2072.     {
  2073.          VfwCaptureDialog_Source = 0x01,
  2074.      VfwCaptureDialog_Format = 0x02,
  2075.      VfwCaptureDialog_Display = 0x04
  2076.     } VfwCaptureDialogs;
  2077.  
  2078.  
  2079.     //---------------------------------------------------------------------
  2080.     //  VfwCompressDialogs enum
  2081.     //---------------------------------------------------------------------
  2082.  
  2083.     typedef enum
  2084.     {
  2085.          VfwCompressDialog_Config = 0x01,
  2086.      VfwCompressDialog_About =  0x02,
  2087.      // returns S_OK if the dialog exists and can be shown, else S_FALSE
  2088.          VfwCompressDialog_QueryConfig = 0x04,
  2089.      VfwCompressDialog_QueryAbout =  0x08
  2090.     } VfwCompressDialogs;
  2091.  
  2092.  
  2093.     //---------------------------------------------------------------------
  2094.     // IAMVfwCaptureDialogs - filter interface
  2095.     //
  2096.     // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY
  2097.     //---------------------------------------------------------------------
  2098.  
  2099.     // This interface is supported only by Microsoft's Video For Windows
  2100.     // capture driver Capture Filter.  It allows an application to bring up
  2101.     // one of the 3 driver dialogs that VfW capture drivers have.
  2102.  
  2103.     [
  2104.     object,
  2105.         local,
  2106.         uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5),
  2107.         pointer_default(unique)
  2108.     ]
  2109.     interface IAMVfwCaptureDialogs : IUnknown
  2110.     {
  2111.         HRESULT HasDialog(
  2112.                     [in]  int iDialog    // VfwCaptureDialogs enum
  2113.         );
  2114.  
  2115.         HRESULT ShowDialog(
  2116.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2117.             [in]  HWND hwnd
  2118.         );
  2119.  
  2120.         HRESULT SendDriverMessage(
  2121.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2122.                     [in]  int uMsg,
  2123.                     [in]  long dw1,
  2124.                     [in]  long dw2
  2125.         );
  2126.  
  2127.         // - iDialog can be one of the VfwCaptureDialogs enums
  2128.         // - HasDialog returns S_OK if it has the dialog, else S_FALSE
  2129.      // - ShowDialog can only be called when not streaming or when another
  2130.     //   dialog is not already up
  2131.     // - SendDriverMessage can send a private message to the capture driver.
  2132.     //   USE IT AT YOUR OWN RISK!
  2133.     }
  2134.  
  2135.     //---------------------------------------------------------------------
  2136.     // IAMVfwCompressDialogs - filter interface
  2137.     //
  2138.     // Show a VfW codec driver dialog - CONFIG or ABOUT
  2139.     //---------------------------------------------------------------------
  2140.  
  2141.     // This interface is supported only by Microsoft's ICM Compressor filter
  2142.     // (Co).  It allows an application to bring up either the Configure or
  2143.     // About dialogs for the ICM codec that it is currently using.
  2144.  
  2145.     [
  2146.     object,
  2147.     local,
  2148.         uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5),
  2149.         pointer_default(unique)
  2150.     ]
  2151.     interface IAMVfwCompressDialogs : IUnknown
  2152.     {
  2153.  
  2154.         // Bring up a dialog for this codec
  2155.         HRESULT ShowDialog(
  2156.                     [in]  int iDialog,   // VfwCompressDialogs enum
  2157.             [in]  HWND hwnd
  2158.         );
  2159.  
  2160.         // Calls ICGetState and gives you the result
  2161.         HRESULT GetState(
  2162.                     [out, size_is(*pcbState)] LPVOID pState,
  2163.             [in, out]  int *pcbState
  2164.         );
  2165.  
  2166.         // Calls ICSetState
  2167.         HRESULT SetState(
  2168.                     [in, size_is(cbState)] LPVOID pState,
  2169.             [in]  int cbState
  2170.         );
  2171.  
  2172.         // Send a codec specific message
  2173.         HRESULT SendDriverMessage(
  2174.                     [in]  int uMsg,
  2175.                     [in]  long dw1,
  2176.                     [in]  long dw2
  2177.         );
  2178.  
  2179.         // - iDialog can be one of the VfwCaptureDialogs enums
  2180.      // - ShowDialog can only be called when not streaming or when no other
  2181.     //   dialog is up already
  2182.      // - an application can call GetState after ShowDialog(CONFIG) to
  2183.     //   see how the compressor was configured and next time the graph
  2184.        //   is used, it can call SetState with the data it saved to return
  2185.     //   the codec to the state configured by the dialog box from last time
  2186.     // - GetState with a NULL pointer returns the size needed
  2187.     // - SendDriverMessage can send a private message to the codec.
  2188.     //   USE IT AT YOUR OWN RISK!
  2189.     }
  2190.  
  2191.  
  2192.     //---------------------------------------------------------------------
  2193.     // IAMDroppedFrames interface
  2194.     //
  2195.     // Report status of capture - pin interface
  2196.     //---------------------------------------------------------------------
  2197.  
  2198.     // A capture filter's video output pin supports this.  It reports
  2199.     // how many frames were not sent (dropped), etc.
  2200.  
  2201.     // Every time your filter goes from STOPPED-->PAUSED, you reset all your
  2202.     // counts to zero.
  2203.  
  2204.     // An app may call this all the time while you are capturing to see how
  2205.     // capturing is going.  MAKE SURE you always return as current information
  2206.     // as possible while you are running.
  2207.  
  2208.     // When your capture filter starts running, it starts by sending frame 0,
  2209.     // then 1, 2, 3, etc.  The time stamp of each frame sent should correspond
  2210.     // to the graph clock's time when the image was digitized.  The end time
  2211.     // is the start time plus the duration of the video frame.
  2212.     // You should also set the MediaTime of each sample (SetMediaTime) as well.
  2213.     // This should be the frame number ie (0,1) (1,2) (2,3).
  2214.     // If a frame is dropped, a downstream filter will be able to tell easily
  2215.     // not by looking for gaps in the regular time stamps, but by noticing a
  2216.     // frame number is missing (eg.  (1,2) (2,3) (4,5) (5,6) means frame 3
  2217.     // was dropped.
  2218.  
  2219.     // Using the info provided by this interface, an application can figure out
  2220.     // the number of frames dropped, the frame rate achieved (the length of
  2221.     // time the graph was running divided by the number of frames not dropped),
  2222.     // and the data rate acheived (the length of time the graph was running
  2223.     // divided by the average frame size).
  2224.  
  2225.     // If your filter is running, then paused, and then run again, you need
  2226.     // to continue to deliver frames as if it was never paused.  The first
  2227.     // frame after the second RUN cannot be time stamped earlier than the last
  2228.     // frame sent before the pause.
  2229.  
  2230.     // Your filter must always increment the MediaTime of each sample sent.
  2231.     // Never send the same frame # twice, and never go back in time.  The
  2232.     // regular time stamp of a sample can also never go back in time.
  2233.  
  2234.     [
  2235.     object,
  2236.         uuid(C6E13344-30AC-11d0-A18C-00A0C9118956),
  2237.         pointer_default(unique)
  2238.     ]
  2239.     interface IAMDroppedFrames : IUnknown
  2240.     {
  2241.         // Get the number of dropped frames
  2242.         HRESULT GetNumDropped(
  2243.                     [out]  long * plDropped
  2244.  
  2245.         );
  2246.  
  2247.         //Get the number of non-dropped frames
  2248.         HRESULT GetNumNotDropped(
  2249.                     [out]  long * plNotDropped
  2250.  
  2251.         );
  2252.  
  2253.     // - plArray points to an array of lSize longs.  The filter will
  2254.     //   fill it with the frame number of the first lSize frames dropped.
  2255.     //   A filter may not have bothered to remember as many as you asked
  2256.     //   for, so it will set *plNumCopied to the number of frames it filled
  2257.     //   in.
  2258.         HRESULT GetDroppedInfo(
  2259.                     [in]   long lSize,
  2260.                     [out]  long * plArray,
  2261.                     [out]  long *  plNumCopied
  2262.         );
  2263.  
  2264.     // - This is the average size of the frames it didn't drop (in bytes)
  2265.         HRESULT GetAverageFrameSize(
  2266.                     [out]  long * plAverageSize
  2267.  
  2268.         );
  2269.  
  2270.     }
  2271.  
  2272.  
  2273.  
  2274.     cpp_quote("#define AMF_AUTOMATICGAIN -1.0")
  2275.  
  2276.     //---------------------------------------------------------------------
  2277.     // IAMAudioInputMixer interface
  2278.     //
  2279.     // Sets the recording levels, pan and EQ for the audio card inputs
  2280.     //---------------------------------------------------------------------
  2281.  
  2282.     // This interface is implemented by each input pin of an audio capture
  2283.     // filter, to tell it what level, panning, and EQ to use for each input.
  2284.     // The name of each pin will reflect the type of input, eg. "Line input 1"
  2285.     // or "Mic".  An application uses the pin names to decide how it wants to
  2286.     // set the recording levels
  2287.  
  2288.     // This interface can also be supported by the audio capture filter itself
  2289.     // to control to overall record level and panning after the mix
  2290.  
  2291.     [
  2292.     object,
  2293.         uuid(54C39221-8380-11d0-B3F0-00AA003761C5),
  2294.         pointer_default(unique)
  2295.     ]
  2296.     interface IAMAudioInputMixer : IUnknown
  2297.     {
  2298.     // This interface is only supported by the input pins, not the filter
  2299.      // If disabled, this channel will not be mixed in as part of the
  2300.     // recorded signal.
  2301.         HRESULT put_Enable (
  2302.             [in] BOOL fEnable);    // TRUE=enable FALSE=disable
  2303.  
  2304.     //Is this channel enabled?
  2305.         HRESULT get_Enable (
  2306.             [out] BOOL *pfEnable);
  2307.  
  2308.     // When set to mono mode, making a stereo recording of this channel
  2309.      // will have both channels contain the same data... a mixture of the
  2310.     // left and right signals
  2311.         HRESULT put_Mono (
  2312.             [in] BOOL fMono);    // TRUE=mono FALSE=multi channel
  2313.  
  2314.         //all channels combined into a mono signal?
  2315.         HRESULT get_Mono (
  2316.             [out] BOOL *pfMono);
  2317.  
  2318.      // !!! WILL CARDS BE ABLE TO BOOST THE GAIN?
  2319.         //Set the record level for this channel
  2320.         HRESULT put_MixLevel (
  2321.                     [in] double Level);    // 0 = off, 1 = full (unity?) volume
  2322.                     // AMF_AUTOMATICGAIN, if supported,
  2323.                     // means automatic
  2324.  
  2325.         //Get the record level for this channel
  2326.         HRESULT get_MixLevel (
  2327.                     [out] double *pLevel);
  2328.  
  2329.     // For instance, when panned full left, and you make a stereo recording
  2330.     // of this channel, you will record a silent right channel.
  2331.         HRESULT put_Pan (
  2332.                     [in] double Pan);    // -1 = full left, 0 = centre, 1 = right
  2333.  
  2334.         //Get the pan for this channel
  2335.         HRESULT get_Pan (
  2336.                     [out] double *pPan);
  2337.  
  2338.     // Boosts the bass of low volume signals before they are recorded
  2339.     // to compensate for the fact that your ear has trouble hearing quiet
  2340.     // bass sounds
  2341.         HRESULT put_Loudness (
  2342.             [in] BOOL fLoudness);// TRUE=on FALSE=off
  2343.  
  2344.         HRESULT get_Loudness (
  2345.             [out] BOOL *pfLoudness);
  2346.  
  2347.     // boosts or cuts the treble of the signal before it's recorded by
  2348.     // a certain amount of dB
  2349.         HRESULT put_Treble (
  2350.                     [in] double Treble); // gain in dB (-ve = attenuate)
  2351.  
  2352.         //Get the treble EQ for this channel
  2353.         HRESULT get_Treble (
  2354.                     [out] double *pTreble);
  2355.  
  2356.     // This is the maximum value allowed in put_Treble.  ie 6.0 means
  2357.     // any value between -6.0 and 6.0 is allowed
  2358.         HRESULT get_TrebleRange (
  2359.                     [out] double *pRange); // largest value allowed
  2360.  
  2361.     // boosts or cuts the bass of the signal before it's recorded by
  2362.     // a certain amount of dB
  2363.         HRESULT put_Bass (
  2364.                     [in] double Bass); // gain in dB (-ve = attenuate)
  2365.  
  2366.         // Get the bass EQ for this channel
  2367.         HRESULT get_Bass (
  2368.                     [out] double *pBass);
  2369.  
  2370.     // This is the maximum value allowed in put_Bass.  ie 6.0 means
  2371.     // any value between -6.0 and 6.0 is allowed
  2372.         HRESULT get_BassRange (
  2373.                     [out] double *pRange); // largest value allowed
  2374.  
  2375.     }
  2376.  
  2377.  
  2378.     //---------------------------------------------------------------------
  2379.     // IAMBufferNegotiation interface
  2380.     //
  2381.     // Tells a pin what kinds of buffers to use when connected
  2382.     //---------------------------------------------------------------------
  2383.  
  2384.     // This interface can be implemented by any pin that will connect to
  2385.     // another pin using IMemInputPin.  All capture filters should support
  2386.     // this interface.
  2387.  
  2388.     // SuggestAllocatorProperties is a way for an application to get
  2389.     // in on the buffer negotiation process for a pin.  This pin will use
  2390.     // the numbers given to it by the application as its request to the
  2391.     // allocator.  An application can use a negative number for any element
  2392.     // in the ALLOCATOR_PROPERTIES to mean "don't care".  An application must
  2393.     // call this function before the pin is connected, or it will be too late
  2394.     // To ensure that an application gets what it wants, it would be wise to
  2395.     // call this method on both pins being connected together, so the other
  2396.     // pin doesn't overrule the application's request.
  2397.  
  2398.     // GetAllocatorProperties can only be called after a pin is connected and
  2399.     // it returns the properties of the current allocator being used
  2400.  
  2401.     [
  2402.     object,
  2403.         uuid(56ED71A0-AF5F-11D0-B3F0-00AA003761C5),
  2404.         pointer_default(unique)
  2405.     ]
  2406.     interface IAMBufferNegotiation : IUnknown
  2407.     {
  2408.         HRESULT SuggestAllocatorProperties (
  2409.             [in] const ALLOCATOR_PROPERTIES *pprop);
  2410.  
  2411.         HRESULT GetAllocatorProperties (
  2412.             [out] ALLOCATOR_PROPERTIES *pprop);
  2413.  
  2414.     }
  2415.  
  2416.  
  2417.     //---------------------------------------------------------------------
  2418.     // AnalogVideoStandard enum
  2419.     //---------------------------------------------------------------------
  2420.  
  2421.     typedef enum tagAnalogVideoStandard
  2422.     {
  2423.         AnalogVideo_None     = 0x00000000,  // This is a digital sensor
  2424.         AnalogVideo_NTSC_M   = 0x00000001,  //        75 IRE Setup
  2425.         AnalogVideo_NTSC_M_J = 0x00000002,  // Japan,  0 IRE Setup
  2426.         AnalogVideo_NTSC_433 = 0x00000004,
  2427.  
  2428.         AnalogVideo_PAL_B    = 0x00000010,
  2429.         AnalogVideo_PAL_D    = 0x00000020,
  2430.         AnalogVideo_PAL_G    = 0x00000040,
  2431.         AnalogVideo_PAL_H    = 0x00000080,
  2432.         AnalogVideo_PAL_I    = 0x00000100,
  2433.         AnalogVideo_PAL_M    = 0x00000200,
  2434.         AnalogVideo_PAL_N    = 0x00000400,
  2435.  
  2436.         AnalogVideo_PAL_60   = 0x00000800,
  2437.  
  2438.         AnalogVideo_SECAM_B  = 0x00001000,
  2439.         AnalogVideo_SECAM_D  = 0x00002000,
  2440.         AnalogVideo_SECAM_G  = 0x00004000,
  2441.         AnalogVideo_SECAM_H  = 0x00008000,
  2442.         AnalogVideo_SECAM_K  = 0x00010000,
  2443.         AnalogVideo_SECAM_K1 = 0x00020000,
  2444.         AnalogVideo_SECAM_L  = 0x00040000,
  2445.         AnalogVideo_SECAM_L1 = 0x00080000,
  2446.  
  2447.         AnalogVideo_PAL_N_COMBO             // Argentina
  2448.                              = 0x00100000
  2449.     } AnalogVideoStandard;
  2450.  
  2451.     cpp_quote("#define AnalogVideo_NTSC_Mask  0x00000007")
  2452.     cpp_quote("#define AnalogVideo_PAL_Mask   0x00100FF0")
  2453.     cpp_quote("#define AnalogVideo_SECAM_Mask 0x000FF000")
  2454.  
  2455.  
  2456.     //---------------------------------------------------------------------
  2457.     // TunerInputType enum
  2458.     //---------------------------------------------------------------------
  2459.  
  2460.     typedef enum tagTunerInputType
  2461.     {
  2462.         TunerInputCable,
  2463.         TunerInputAntenna
  2464.     } TunerInputType;
  2465.  
  2466.     //---------------------------------------------------------------------
  2467.     // VideoCopyProtectionType enum
  2468.     //---------------------------------------------------------------------
  2469.  
  2470.     typedef enum
  2471.     {
  2472.         VideoCopyProtectionMacrovisionBasic,
  2473.         VideoCopyProtectionMacrovisionCBI
  2474.     } VideoCopyProtectionType;
  2475.  
  2476.     //---------------------------------------------------------------------
  2477.     // PhysicalConnectorType enum
  2478.     //---------------------------------------------------------------------
  2479.  
  2480.     typedef enum tagPhysicalConnectorType
  2481.     {
  2482.         PhysConn_Video_Tuner = 1,
  2483.         PhysConn_Video_Composite,
  2484.         PhysConn_Video_SVideo,
  2485.         PhysConn_Video_RGB,
  2486.         PhysConn_Video_YRYBY,
  2487.         PhysConn_Video_SerialDigital,
  2488.         PhysConn_Video_ParallelDigital,
  2489.         PhysConn_Video_SCSI,
  2490.         PhysConn_Video_AUX,
  2491.         PhysConn_Video_1394,
  2492.         PhysConn_Video_USB,
  2493.         PhysConn_Video_VideoDecoder,
  2494.         PhysConn_Video_VideoEncoder,
  2495.         PhysConn_Video_SCART,
  2496.         PhysConn_Video_Black,            
  2497.  
  2498.  
  2499.         PhysConn_Audio_Tuner = 0x1000,
  2500.         PhysConn_Audio_Line,
  2501.         PhysConn_Audio_Mic,
  2502.         PhysConn_Audio_AESDigital,
  2503.         PhysConn_Audio_SPDIFDigital,
  2504.         PhysConn_Audio_SCSI,
  2505.         PhysConn_Audio_AUX,
  2506.         PhysConn_Audio_1394,
  2507.         PhysConn_Audio_USB,
  2508.         PhysConn_Audio_AudioDecoder,
  2509.     } PhysicalConnectorType;
  2510.  
  2511.  
  2512.  
  2513.  
  2514.     //---------------------------------------------------------------------
  2515.     // IAMAnalogVideoDecoder interface
  2516.     //---------------------------------------------------------------------
  2517.  
  2518.     [
  2519.     object,
  2520.         uuid(C6E13350-30AC-11d0-A18C-00A0C9118956),
  2521.     pointer_default(unique)
  2522.     ]
  2523.     interface IAMAnalogVideoDecoder : IUnknown
  2524.     {
  2525.  
  2526.          //Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1...
  2527.         HRESULT get_AvailableTVFormats(
  2528.                     [out] long *lAnalogVideoStandard
  2529.                     );
  2530.  
  2531.         //Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2532.         HRESULT put_TVFormat(
  2533.                     [in] long lAnalogVideoStandard
  2534.                     );
  2535.  
  2536.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2537.         HRESULT get_TVFormat(
  2538.                     [out] long * plAnalogVideoStandard
  2539.                     );
  2540.  
  2541.         // True if horizontal sync is locked
  2542.         HRESULT get_HorizontalLocked (
  2543.                     [out] long * plLocked);
  2544.  
  2545.         // True if connected to a VCR (changes PLL timing)
  2546.         HRESULT put_VCRHorizontalLocking (
  2547.                     [in] long lVCRHorizontalLocking);
  2548.  
  2549.         HRESULT get_VCRHorizontalLocking (
  2550.                     [out] long * plVCRHorizontalLocking);
  2551.  
  2552.         // Returns the number of lines in the video signal")]
  2553.         HRESULT get_NumberOfLines (
  2554.                     [out] long *plNumberOfLines);
  2555.  
  2556.         // Enables or disables the output bus
  2557.         HRESULT put_OutputEnable (
  2558.                     [in] long lOutputEnable);
  2559.  
  2560.         HRESULT get_OutputEnable (
  2561.                     [out] long *plOutputEnable);
  2562.  
  2563.     }
  2564.  
  2565.  
  2566.     //---------------------------------------------------------------------
  2567.     // VideoProcAmp Property enum
  2568.     //---------------------------------------------------------------------
  2569.  
  2570.     typedef enum tagVideoProcAmpProperty
  2571.     {
  2572.         VideoProcAmp_Brightness,
  2573.         VideoProcAmp_Contrast,
  2574.         VideoProcAmp_Hue,
  2575.         VideoProcAmp_Saturation,
  2576.         VideoProcAmp_Sharpness,
  2577.         VideoProcAmp_Gamma,
  2578.         VideoProcAmp_ColorEnable,
  2579.         VideoProcAmp_WhiteBalance,
  2580.         VideoProcAmp_BacklightCompensation,
  2581.         VideoProcAmp_Gain
  2582.     } VideoProcAmpProperty;
  2583.  
  2584.     //---------------------------------------------------------------------
  2585.     // VideoProcAmp Flags enum
  2586.     //---------------------------------------------------------------------
  2587.  
  2588.     typedef enum tagVideoProcAmpFlags
  2589.     {
  2590.         VideoProcAmp_Flags_Auto   = 0x0001,
  2591.         VideoProcAmp_Flags_Manual = 0x0002
  2592.     } VideoProcAmpFlags;
  2593.  
  2594.     //---------------------------------------------------------------------
  2595.     // IAMVideoProcAmp interface
  2596.     //
  2597.     // Adjusts video quality in either the analog or digital domain.
  2598.     //
  2599.     //---------------------------------------------------------------------
  2600.  
  2601.     [
  2602.     object,
  2603.         uuid(C6E13360-30AC-11d0-A18C-00A0C9118956),
  2604.     pointer_default(unique)
  2605.     ]
  2606.     interface IAMVideoProcAmp : IUnknown
  2607.     {
  2608.         // Returns min, max, step size, and default values
  2609.         HRESULT GetRange(
  2610.             [in] long Property,         // Which property to query
  2611.             [out] long * pMin,          // Range minimum
  2612.             [out] long * pMax,          // Range maxumum
  2613.             [out] long * pSteppingDelta,// Step size
  2614.             [out] long * pDefault,      // Default value
  2615.             [out] long * pCapsFlags     // VideoProcAmpFlags
  2616.  
  2617.         );
  2618.  
  2619.         // Set a VideoProcAmp property
  2620.         HRESULT Set(
  2621.             [in]  long Property,        // VideoProcAmpProperty
  2622.             [in]  long lValue,          // Value to set
  2623.             [in]  long Flags            // VideoProcAmp_Flags_*
  2624.  
  2625.         );
  2626.  
  2627.         // Get a VideoProcAmp property
  2628.         HRESULT Get(
  2629.             [in]  long Property,        // VideoProcAmpProperty
  2630.             [out] long * lValue,        // Current value
  2631.             [out] long * Flags          // VideoProcAmp_Flags_*
  2632.         );
  2633.     }
  2634.  
  2635.  
  2636.     //---------------------------------------------------------------------
  2637.     // CameraControl Property enum
  2638.     //---------------------------------------------------------------------
  2639.  
  2640.     typedef enum tagCameraControlProperty
  2641.     {
  2642.         CameraControl_Pan,
  2643.         CameraControl_Tilt,
  2644.         CameraControl_Roll,
  2645.         CameraControl_Zoom,
  2646.         CameraControl_Exposure,
  2647.         CameraControl_Iris,
  2648.         CameraControl_Focus
  2649.     } CameraControlProperty;
  2650.  
  2651.     //---------------------------------------------------------------------
  2652.     // CameraControl Flags enum
  2653.     //---------------------------------------------------------------------
  2654.  
  2655.     typedef enum tagCameraControlFlags
  2656.     {
  2657.         CameraControl_Flags_Auto     = 0x0001,
  2658.         CameraControl_Flags_Manual   = 0x0002
  2659.     } CameraControlFlags;
  2660.  
  2661.     //---------------------------------------------------------------------
  2662.     // IAMCameraControl interface
  2663.     //
  2664.     // Control of local or remote cameras
  2665.     //---------------------------------------------------------------------
  2666.  
  2667.     [
  2668.     object,
  2669.         uuid(C6E13370-30AC-11d0-A18C-00A0C9118956),
  2670.     pointer_default(unique)
  2671.     ]
  2672.     interface IAMCameraControl : IUnknown
  2673.     {
  2674.         // Returns min, max, step size, and default values
  2675.         HRESULT GetRange(
  2676.             [in] long Property,         // Which property to query
  2677.             [out] long * pMin,          // Range minimum
  2678.             [out] long * pMax,          // Range maxumum
  2679.             [out] long * pSteppingDelta,// Step size
  2680.             [out] long * pDefault,      // Default value
  2681.             [out] long * pCapsFlags     // CamaeraControlFlags
  2682.  
  2683.         );
  2684.  
  2685.         // Set a CameraControl property
  2686.         HRESULT Set(
  2687.             [in]  long Property,        // CameraControlProperty
  2688.             [in]  long lValue,          // Value to set
  2689.             [in]  long Flags            // CameraControl_Flags_*
  2690.  
  2691.         );
  2692.  
  2693.         // Get a CameraControl property
  2694.         HRESULT Get(
  2695.             [in]  long Property,        // CameraControlProperty
  2696.             [out] long * lValue,        // Current value
  2697.             [out] long * Flags          // CameraControl_Flags_*
  2698.         );
  2699.     }
  2700.  
  2701.     //---------------------------------------------------------------------
  2702.     // VideoControl Flags enum
  2703.     //---------------------------------------------------------------------
  2704.  
  2705.     typedef enum tagVideoControlFlags
  2706.     {
  2707.         VideoControlFlag_FlipHorizontal        = 0x0001,
  2708.         VideoControlFlag_FlipVertical          = 0x0002,
  2709.         VideoControlFlag_ExternalTriggerEnable = 0x0004,
  2710.         VideoControlFlag_Trigger               = 0x0008
  2711.  
  2712.     } VideoControlFlags;
  2713.  
  2714.     //---------------------------------------------------------------------
  2715.     // IAMVideoControl interface
  2716.     //
  2717.     // Control of horizontal & vertical flip, external trigger,
  2718.     // and listing available frame rates
  2719.     //---------------------------------------------------------------------
  2720.  
  2721.     [
  2722.     object,
  2723.         uuid(6a2e0670-28e4-11d0-a18c-00a0c9118956),
  2724.     pointer_default(unique)
  2725.     ]
  2726.     interface IAMVideoControl : IUnknown
  2727.     {
  2728.         // What can the underlying hardware do?
  2729.         HRESULT GetCaps(
  2730.             [in]  IPin * pPin,          // the pin to query or control
  2731.             [out] long * pCapsFlags     // VideoControlFlag_*
  2732.  
  2733.         );
  2734.  
  2735.         // Set the mode of operation
  2736.         HRESULT SetMode(
  2737.             [in]  IPin * pPin,          // the pin to query or control
  2738.             [in]  long Mode             // VideoControlFlag_*
  2739.  
  2740.         );
  2741.  
  2742.         // Get the mode of operation
  2743.         HRESULT GetMode(
  2744.             [in]  IPin * pPin,          // the pin to query or control
  2745.             [out] long * Mode           // VideoControlFlag_*
  2746.         );
  2747.  
  2748.         // Get actual frame rate info for USB and 1394
  2749.         // This is only available when streaming
  2750.         HRESULT GetCurrentActualFrameRate(
  2751.             [in]  IPin * pPin,                  // the pin to query or control
  2752.             [out] LONGLONG * ActualFrameRate    // 100 nS units
  2753.         );
  2754.  
  2755.         // Get max available frame rate info for USB and 1394
  2756.         // Returns the max frame rate currently available based on bus bandwidth usage
  2757.         HRESULT GetMaxAvailableFrameRate(
  2758.             [in]  IPin * pPin,          // the pin to query or control
  2759.             [in]  long iIndex,          // 0 to IAMStreamConfig->GetNumberOfCapabilities-1
  2760.             [in]  SIZE Dimensions,      // width and height
  2761.             [out] LONGLONG * MaxAvailableFrameRate  // 100 nS units
  2762.         );
  2763.  
  2764.         // Get List of available frame rates
  2765.         HRESULT GetFrameRateList(
  2766.             [in]  IPin * pPin,           // the pin to query or control
  2767.             [in]  long iIndex,           // 0 to IAMStreamConfig->GetNumberOfCapabilities-1
  2768.             [in]  SIZE Dimensions,       // width and height
  2769.             [out] long * ListSize,       // Number of elements in the list
  2770.             [out] LONGLONG ** FrameRates // Array of framerates in 100 nS units
  2771.                                          // or NULL to just get ListSize
  2772.         );
  2773.  
  2774.     }
  2775.  
  2776.  
  2777.     //---------------------------------------------------------------------
  2778.     // IAMCrossbar interface
  2779.     //
  2780.     // Controls a routing matrix for analog or digital video or audio
  2781.     //---------------------------------------------------------------------
  2782.  
  2783.     [
  2784.     object,
  2785.         uuid(C6E13380-30AC-11d0-A18C-00A0C9118956),
  2786.     pointer_default(unique)
  2787.     ]
  2788.     interface IAMCrossbar : IUnknown
  2789.     {
  2790.  
  2791.         // How many pins are there?
  2792.         HRESULT get_PinCounts(
  2793.                 [out] long * OutputPinCount,        // count of output pins
  2794.                 [out] long * InputPinCount);        // count of input pins
  2795.  
  2796.         // True if routing is possible
  2797.         HRESULT CanRoute (
  2798.                 [in]  long OutputPinIndex,          // the output pin
  2799.                 [in]  long InputPinIndex);          // the input pin
  2800.  
  2801.         // Routes an input pin to an output pin
  2802.         HRESULT Route (
  2803.                 [in]  long OutputPinIndex,          // the output pin
  2804.                 [in]  long InputPinIndex);          // the input pin
  2805.  
  2806.         // Returns the input pin connected to a given output pin
  2807.         HRESULT get_IsRoutedTo (
  2808.                 [in]  long OutputPinIndex,          // the output pin
  2809.                 [out] long * InputPinIndex);        // the connected input pin
  2810.  
  2811.         // Returns a pin which is related to a given pin
  2812.         // (ie. this audio pin is related to a video pin)
  2813.         HRESULT get_CrossbarPinInfo (
  2814.                 [in] BOOL IsInputPin,               // TRUE for input pins
  2815.                 [in] long PinIndex,                 // a pin
  2816.                 [out] long * PinIndexRelated,       // Index of related pin
  2817.                 [out] long * PhysicalType);         // Physical type of pin
  2818.  
  2819.     }
  2820.  
  2821.  
  2822.     //---------------------------------------------------------------------
  2823.     // IAMTuner interface
  2824.     //
  2825.     // base tuner device
  2826.     //---------------------------------------------------------------------
  2827.     
  2828.     // predefined subchannel values
  2829.     typedef enum tagAMTunerSubChannel
  2830.     {
  2831.         AMTUNER_SUBCHAN_NO_TUNE     = -2,   // don't tune
  2832.         AMTUNER_SUBCHAN_DEFAULT     = -1    // use default sub chan
  2833.     } AMTunerSubChannel;
  2834.     
  2835.     // predefined signal strength values
  2836.     typedef enum tagAMTunerSignalStrength
  2837.     {
  2838.         AMTUNER_HASNOSIGNALSTRENGTH = -1,   // cannot indicate signal strength
  2839.         AMTUNER_NOSIGNAL            = 0,    // no signal available
  2840.         AMTUNER_SIGNALPRESENT       = 1     // signal present
  2841.     } AMTunerSignalStrength;
  2842.  
  2843.     // specifies the mode of operation of the tuner    
  2844.     typedef enum tagAMTunerModeType
  2845.     {
  2846.         AMTUNER_MODE_DEFAULT    = 0x0000,   // default tuner mode
  2847.         AMTUNER_MODE_TV         = 0x0001,   // tv
  2848.         AMTUNER_MODE_FM_RADIO   = 0x0002,   // fm radio
  2849.         AMTUNER_MODE_AM_RADIO   = 0x0004,   // am radio
  2850.         AMTUNER_MODE_DSS        = 0x0008,   // dss
  2851.     } AMTunerModeType;
  2852.     
  2853.     // Events reported by IAMTunerNotification
  2854.     typedef enum tagAMTunerEventType{
  2855.         AMTUNER_EVENT_CHANGED   = 0x0001,   // status changed
  2856.     } AMTunerEventType;
  2857.     
  2858.     interface IAMTunerNotification;
  2859.  
  2860.     [
  2861.         object,
  2862.         uuid(211A8761-03AC-11d1-8D13-00AA00BD8339),
  2863.         pointer_default(unique)
  2864.     ]
  2865.     interface IAMTuner : IUnknown
  2866.     {
  2867.         // Sets and gets the Channel
  2868.         HRESULT put_Channel(
  2869.             [in] long lChannel,
  2870.             [in] long lVideoSubChannel,
  2871.             [in] long lAudioSubChannel
  2872.             );
  2873.         HRESULT get_Channel(
  2874.             [out] long *plChannel,
  2875.             [out] long *plVideoSubChannel,
  2876.             [out] long *plAudioSubChannel
  2877.             );
  2878.     
  2879.         // Gets the minimum and maximum channel available
  2880.         HRESULT ChannelMinMax(
  2881.             [out] long *lChannelMin,
  2882.             [out] long *lChannelMax
  2883.             );
  2884.     
  2885.         // CountryCode is the same as the international
  2886.         // long distance telephone dialing prefix
  2887.         
  2888.         HRESULT put_CountryCode(
  2889.             [in] long lCountryCode
  2890.             );
  2891.         HRESULT get_CountryCode(
  2892.             [out] long *plCountryCode
  2893.             );
  2894.     
  2895.         HRESULT put_TuningSpace(
  2896.             [in] long lTuningSpace
  2897.             );
  2898.         HRESULT get_TuningSpace(
  2899.             [out] long *plTuningSpace
  2900.             );
  2901.     
  2902.         [local] HRESULT Logon(
  2903.             [in] HANDLE hCurrentUser
  2904.             );
  2905.         HRESULT Logout();
  2906.     
  2907.         // Signal status for current channel
  2908.         // signal strength == TUNER_NOSIGNAL, or strength value
  2909.         HRESULT SignalPresent(
  2910.             [out] long * plSignalStrength    // AMTunerSignalStrength
  2911.             );
  2912.     
  2913.         // allow multifunction tuner to be switch between modes
  2914.         HRESULT put_Mode(
  2915.             [in] AMTunerModeType lMode        // AMTunerModeType
  2916.             );
  2917.         HRESULT get_Mode(
  2918.             [out] AMTunerModeType *plMode    // AMTunerModeType
  2919.             );
  2920.     
  2921.         // retrieve a bitmask of the possible modes
  2922.         HRESULT GetAvailableModes(
  2923.             [out] long *plModes                // AMTunerModeType
  2924.             );
  2925.     
  2926.         // allow IAMTuner clients to receive event notification
  2927.         HRESULT RegisterNotificationCallBack(
  2928.             [in] IAMTunerNotification *pNotify,
  2929.             [in] long lEvents       // bitmask from AMTunerEventType enumeration
  2930.             );
  2931.         HRESULT UnRegisterNotificationCallBack(
  2932.                         [in] IAMTunerNotification *pNotify
  2933.             );
  2934.     }
  2935.     
  2936.     //---------------------------------------------------------------------
  2937.     // IAMTunerNotification interface
  2938.     //
  2939.     // Provided to IAMTuner if notification callbacks are desired
  2940.     //---------------------------------------------------------------------
  2941.     
  2942.     [
  2943.         object,
  2944.         uuid(211A8760-03AC-11d1-8D13-00AA00BD8339),
  2945.         pointer_default(unique)
  2946.     ]
  2947.     interface IAMTunerNotification : IUnknown
  2948.     {
  2949.         HRESULT OnEvent([in] AMTunerEventType Event);
  2950.     }
  2951.     
  2952.     
  2953.     //---------------------------------------------------------------------
  2954.     // IAMTVTuner interface
  2955.     //
  2956.     // Controls an analog TV tuner device
  2957.     //---------------------------------------------------------------------
  2958.  
  2959.     [
  2960.         object,
  2961.         uuid(211A8766-03AC-11d1-8D13-00AA00BD8339),
  2962.         pointer_default(unique)
  2963.     ]
  2964.     interface IAMTVTuner : IAMTuner
  2965.     {
  2966.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...
  2967.         HRESULT get_AvailableTVFormats(
  2968.             [out] long *lAnalogVideoStandard
  2969.             );
  2970.     
  2971.         // Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  2972.         HRESULT get_TVFormat(
  2973.             [out] long * plAnalogVideoStandard
  2974.             );
  2975.     
  2976.         // Scans for a signal on a given channel
  2977.         // NOTE: this is equivalent to put_Channel(), SignalStrength()
  2978.         HRESULT AutoTune(
  2979.             [in] long lChannel,
  2980.             [out] long * plFoundSignal
  2981.             );
  2982.     
  2983.         // Saves the fine tuning information for all channels")]
  2984.         HRESULT StoreAutoTune();
  2985.     
  2986.         // The number of TV sources plugged into the tuner
  2987.         HRESULT get_NumInputConnections(
  2988.             [out] long * plNumInputConnections
  2989.             );
  2990.     
  2991.         // Sets or gets the tuner input type (Cable or Antenna)
  2992.         HRESULT put_InputType(
  2993.             [in] long lIndex,
  2994.             [in] TunerInputType InputType
  2995.             );
  2996.         HRESULT get_InputType(
  2997.             [in] long lIndex,
  2998.             [out] TunerInputType * pInputType
  2999.             );
  3000.     
  3001.         // Sets or gets the tuner input
  3002.         HRESULT put_ConnectInput(
  3003.             [in] long lIndex
  3004.             );
  3005.         HRESULT get_ConnectInput(
  3006.             [out] long *plIndex
  3007.             );
  3008.     
  3009.         // Gets the video and audio carrier frequencies
  3010.         HRESULT get_VideoFrequency(
  3011.             [out] long *lFreq
  3012.             );
  3013.         HRESULT get_AudioFrequency(
  3014.             [out] long *lFreq
  3015.             );
  3016.     }
  3017.  
  3018.     
  3019.     //---------------------------------------------------------------------
  3020.     // IBPCSatelliteTuner interface
  3021.     //
  3022.     // An interface supporting Satellite tuning-related functions
  3023.     //---------------------------------------------------------------------
  3024.     [
  3025.         object,
  3026.         local,
  3027.         uuid(211A8765-03AC-11d1-8D13-00AA00BD8339),
  3028.         pointer_default(unique)
  3029.     ]
  3030.     interface IBPCSatelliteTuner : IAMTuner
  3031.     {
  3032.         HRESULT get_DefaultSubChannelTypes(
  3033.             [out] long *plDefaultVideoType, // Provider-specific service type
  3034.             [out] long *plDefaultAudioType  // Provider-specific service type
  3035.             );
  3036.     
  3037.         HRESULT put_DefaultSubChannelTypes(
  3038.             [in] long lDefaultVideoType,    // Provider-specific service type
  3039.             [in] long lDefaultAudioType     // Provider-specific service type
  3040.             );
  3041.     
  3042.         HRESULT IsTapingPermitted();        // S_OK yes, S_FALSE no
  3043.     }
  3044.  
  3045.  
  3046.  
  3047.     //---------------------------------------------------------------------
  3048.     // IAMTVAudio interface
  3049.     //
  3050.     // TV Audio control
  3051.     //---------------------------------------------------------------------
  3052.     
  3053.     typedef enum tagTVAudioMode
  3054.     {
  3055.         AMTVAUDIO_MODE_MONO            = 0x0001,       // Mono                   
  3056.         AMTVAUDIO_MODE_STEREO       = 0x0002,       // Stereo
  3057.         AMTVAUDIO_MODE_LANG_A       = 0x0010,       // Primary language
  3058.         AMTVAUDIO_MODE_LANG_B       = 0x0020,       // 2nd avail language
  3059.         AMTVAUDIO_MODE_LANG_C       = 0x0040,       // 3rd avail language
  3060.     } TVAudioMode;
  3061.  
  3062.     // Events reported by IAMTVAudioNotification
  3063.     typedef enum tagAMTVAudioEventType
  3064.     {
  3065.         AMTVAUDIO_EVENT_CHANGED     = 0x0001,       // mode changed
  3066.     } AMTVAudioEventType;
  3067.  
  3068.     interface IAMTVAudioNotification;
  3069.  
  3070.     [
  3071.         object,
  3072.         local,
  3073.         uuid(83EC1C30-23D1-11d1-99E6-00A0C9560266),
  3074.         pointer_default(unique)
  3075.     ]
  3076.     interface IAMTVAudio : IUnknown
  3077.     {
  3078.         // retrieve a bitmask of the formats available in the hardware
  3079.         HRESULT GetHardwareSupportedTVAudioModes(
  3080.             [out] long *plModes                // TVAudioMode
  3081.             );
  3082.             
  3083.         // retrieve a bitmask of the possible modes
  3084.         HRESULT GetAvailableTVAudioModes(
  3085.             [out] long *plModes                // TVAudioMode
  3086.             );
  3087.             
  3088.         HRESULT get_TVAudioMode(
  3089.             [out] long *plMode              // TVAudioMode
  3090.             );
  3091.         HRESULT put_TVAudioMode(
  3092.             [in] long lMode                    // TVAudioMode
  3093.             );
  3094.  
  3095.         // allow IAMTVAudio clients to receive event notification
  3096.         HRESULT RegisterNotificationCallBack(
  3097.             [in] IAMTunerNotification *pNotify,
  3098.             [in] long lEvents       // bitmask from AMTVAudioEventType enumeration
  3099.             );
  3100.         HRESULT UnRegisterNotificationCallBack(
  3101.             IAMTunerNotification *pNotify
  3102.             );
  3103.     }
  3104.  
  3105.     //---------------------------------------------------------------------
  3106.     // IAMTVAudioNotification interface
  3107.     //
  3108.     // Provided to IAMTVAudio clients if notification callbacks are desired
  3109.     //---------------------------------------------------------------------
  3110.     
  3111.     [
  3112.         object,
  3113.         local,
  3114.         uuid(83EC1C33-23D1-11d1-99E6-00A0C9560266),
  3115.         pointer_default(unique)
  3116.     ]
  3117.     interface IAMTVAudioNotification : IUnknown
  3118.     {
  3119.         HRESULT OnEvent([in] AMTVAudioEventType Event);
  3120.     }
  3121.  
  3122.  
  3123.  
  3124.  
  3125.     //---------------------------------------------------------------------
  3126.     // IAMAnalogVideoEncoder interface
  3127.     //---------------------------------------------------------------------
  3128.  
  3129.     [
  3130.    object,
  3131.         uuid(C6E133B0-30AC-11d0-A18C-00A0C9118956),
  3132.     pointer_default(unique)
  3133.     ]
  3134.     interface IAMAnalogVideoEncoder : IUnknown
  3135.     {
  3136.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...)
  3137.         HRESULT get_AvailableTVFormats(
  3138.                     [out] long *lAnalogVideoStandard
  3139.                     );
  3140.  
  3141.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  3142.         HRESULT put_TVFormat(
  3143.                     [in] long lAnalogVideoStandard
  3144.                     );
  3145.  
  3146.         HRESULT get_TVFormat(
  3147.                     [out] long * plAnalogVideoStandard
  3148.                     );
  3149.  
  3150.         // Sets or gets the copy protection
  3151.         HRESULT put_CopyProtection (
  3152.                     [in]  long lVideoCopyProtection); // VideoCopyProtectionType
  3153.  
  3154.         HRESULT get_CopyProtection (
  3155.                     [out] long *lVideoCopyProtection); // VideoCopyProtectionType
  3156.  
  3157.  
  3158.         // Enables and disables close captioning
  3159.         HRESULT put_CCEnable (
  3160.                     [in] long lCCEnable);
  3161.  
  3162.         HRESULT get_CCEnable (
  3163.                     [out] long *lCCEnable);
  3164.  
  3165.     }
  3166.  
  3167.     // used by IKsPropertySet set AMPROPSETID_Pin
  3168.     typedef enum {
  3169.     AMPROPERTY_PIN_CATEGORY,
  3170.         AMPROPERTY_PIN_MEDIUM
  3171.     } AMPROPERTY_PIN;
  3172.  
  3173.     //---------------------------------------------------------------------
  3174.     // IKsPropertySet interface
  3175.     //
  3176.     // Sets or gets a property identified by a property set GUID and a
  3177.     // property ID.
  3178.     //
  3179.     // Return codes for all 3 methods:
  3180.     //    E_PROP_SET_UNSUPPORTED  the property set is not supported
  3181.     //    E_PROP_ID_UNSUPPORTED   the property ID is not supported
  3182.     //                                for the specified property set
  3183.     //---------------------------------------------------------------------
  3184.  
  3185. cpp_quote("#ifndef _IKsPropertySet_")
  3186. cpp_quote("#define _IKsPropertySet_")
  3187.  
  3188.     //---------------------------------------------------------------------
  3189.     // #defines for IKsPropertySet::QuerySupported return result in pTypeSupport
  3190.     //---------------------------------------------------------------------
  3191.  
  3192. cpp_quote("#define KSPROPERTY_SUPPORT_GET  1")
  3193. cpp_quote("#define KSPROPERTY_SUPPORT_SET  2")
  3194.  
  3195.  
  3196.     [
  3197.     object,
  3198.         uuid(31EFAC30-515C-11d0-A9AA-00AA0061BE93),
  3199.     pointer_default(unique)
  3200.     ]
  3201.     interface IKsPropertySet : IUnknown
  3202.     {
  3203.         [local] HRESULT Set(
  3204.                     [in]    REFGUID     guidPropSet,
  3205.                     [in]    DWORD       dwPropID,
  3206.                     [in, size_is(cbInstanceData)] LPVOID pInstanceData,
  3207.                     [in]    DWORD        cbInstanceData,
  3208.                     [in, size_is(cbPropData)] LPVOID pPropData,
  3209.                     [in]    DWORD        cbPropData);
  3210.  
  3211.         [call_as(Set)] HRESULT RemoteSet(
  3212.                     [in]    REFGUID     guidPropSet,
  3213.                     [in]    DWORD       dwPropID,
  3214.                     [in, size_is(cbInstanceData)] byte * pInstanceData,
  3215.                     [in]    DWORD        cbInstanceData,
  3216.                     [in, size_is(cbPropData)] byte * pPropData,
  3217.                     [in]    DWORD        cbPropData);
  3218.  
  3219.         // To get a property, the caller allocates a buffer which the called
  3220.         // function fills in.  To determine necessary buffer size, call Get with
  3221.         // pPropData=NULL and cbPropData=0.
  3222.         [local] HRESULT Get(
  3223.                     [in]    REFGUID     guidPropSet,
  3224.                     [in]    DWORD       dwPropID,
  3225.                     [in, size_is(cbInstanceData)] LPVOID pInstanceData,
  3226.                     [in]    DWORD        cbInstanceData,
  3227.                     [out, size_is(cbPropData)] LPVOID pPropData,
  3228.                     [in]    DWORD        cbPropData,
  3229.                     [out]   DWORD *        pcbReturned);
  3230.  
  3231.         [call_as(Get)] HRESULT RemoteGet(
  3232.                     [in]    REFGUID     guidPropSet,
  3233.                     [in]    DWORD       dwPropID,
  3234.                     [in, size_is(cbInstanceData)] byte * pInstanceData,
  3235.                     [in]    DWORD        cbInstanceData,
  3236.                     [out, size_is(cbPropData)] byte * pPropData,
  3237.                     [in]    DWORD        cbPropData,
  3238.                     [out]   DWORD *        pcbReturned);
  3239.         // QuerySupported must either return E_NOTIMPL or correctly indicate
  3240.         // if getting or setting the property set and property is supported.
  3241.         // S_OK indicates the property set and property ID combination is
  3242.         HRESULT QuerySupported(
  3243.                     [in]    REFGUID     guidPropSet,
  3244.                     [in]    DWORD       dwPropID,
  3245.                     [out]   DWORD       *pTypeSupport);
  3246.     }
  3247. cpp_quote("#endif // _IKsPropertySet_")
  3248.  
  3249. [
  3250. object,
  3251. uuid(6025A880-C0D5-11d0-BD4E-00A0C911CE86),
  3252. pointer_default(unique)
  3253. ]
  3254. interface IMediaPropertyBag : IPropertyBag
  3255. {
  3256.     import "ocidl.idl";
  3257.  
  3258.     typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG;
  3259.  
  3260.     // return the i'th element in the property bag
  3261.     HRESULT EnumProperty(
  3262.         [in]  ULONG iProperty,
  3263.         [in, out] VARIANT * pvarPropertyName,
  3264.         [in, out] VARIANT * pvarPropertyValue
  3265.         );
  3266.  
  3267. }
  3268.  
  3269.  
  3270. [
  3271. object,
  3272. uuid(5738E040-B67F-11d0-BD4D-00A0C911CE86),
  3273. pointer_default(unique)
  3274. ]
  3275. interface IPersistMediaPropertyBag : IPersist
  3276. {
  3277.     import "ocidl.idl";
  3278.     import "unknwn.idl";
  3279.  
  3280.     HRESULT InitNew(
  3281.         void
  3282.         );
  3283.  
  3284.     HRESULT Load(
  3285.         [in] IMediaPropertyBag * pPropBag,
  3286.         [in] IErrorLog * pErrorLog
  3287.         );
  3288.  
  3289.     HRESULT Save(
  3290.         [in] IMediaPropertyBag * pPropBag,
  3291.         [in] BOOL fClearDirty,
  3292.         [in] BOOL fSaveAllProperties
  3293.         );
  3294.  
  3295.  
  3296.     typedef IPersistMediaPropertyBag * LPPERSISTMEDIAPROPERTYBAG;
  3297. }
  3298.  
  3299.  
  3300.    //---------------------------------------------------------------------
  3301.    //
  3302.    // Defines IAMPhysicalPinInfo Interface
  3303.    //
  3304.    // Returns an enum and string that describes an input pin's physical type.
  3305.    //
  3306.    // Implement if: you have physical input pins such as video or audio (like
  3307.    // on a video capture card or a VCR)
  3308.    //
  3309.    // Use if: you want to communicate to a user available physical input pins
  3310.    // and allow them to select the active one if there is more than one
  3311.    //---------------------------------------------------------------------
  3312.  
  3313.  
  3314. [
  3315.     object,
  3316.      uuid(F938C991-3029-11cf-8C44-00AA006B6814),
  3317.      pointer_default(unique)
  3318.  ]
  3319. interface IAMPhysicalPinInfo : IUnknown {
  3320.  
  3321.     // Returns VFW_E_NO_ACCEPTABLE_TYPES if not a physical pin
  3322.     HRESULT GetPhysicalType(
  3323.         [out] long *pType,            // the enum representing the Physical Type
  3324.         [out] LPOLESTR *ppszType        // a friendly name
  3325.     );
  3326. }
  3327. typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO;
  3328.  
  3329.    //---------------------------------------------------------------------
  3330.    // Defines IAMExtDevice Interface
  3331.    //
  3332.    // Base interface for external professional devices
  3333.    //
  3334.    // Implement if: the filter controls an external device such as a VCR,
  3335.    // timecode reader/generator, etc.  The intent is to build a object from
  3336.    // this implementation plus another that specifically describes the device,
  3337.    // such as IAMExtTransport.
  3338.    //
  3339.    // Use if: you want to control and external device such as a VCR
  3340.    //
  3341.    // See edevdefs.h for the enumerated parameter list
  3342.    //---------------------------------------------------------------------
  3343.  [
  3344.     object,
  3345.      uuid(B5730A90-1A2C-11cf-8C23-00AA006B6814),
  3346.     pointer_default(unique)
  3347.  ]
  3348.  interface IAMExtDevice : IUnknown
  3349.  {
  3350.     // General device capabilities property.  See edevdefs.h for supported
  3351.     // values
  3352.     HRESULT GetCapability(
  3353.          [in] long Capability,        // identify the property
  3354.         [out] long *pValue,            // return value
  3355.         [out] double *pdblValue        // return value
  3356.      );
  3357.  
  3358.     // Get external device identification string.  Usually the model #
  3359.     // of the device
  3360.     HRESULT get_ExternalDeviceID(
  3361.         [out] LPOLESTR *ppszData        // ID string
  3362.     );
  3363.     
  3364.     HRESULT get_ExternalDeviceVersion(
  3365.         [out] LPOLESTR *ppszData        // revision string
  3366.     );
  3367.     
  3368.     // Controls the external device's power mode
  3369.     HRESULT put_DevicePower([in] long PowerMode
  3370.     );
  3371.     HRESULT get_DevicePower([out] long *pPowerMode
  3372.     );
  3373.     
  3374.     // Some devices need to be reset in some way, i.e., rewinding a VCR
  3375.     // to the beginning of the tape and resetting the counter to zero.
  3376.     HRESULT Calibrate(
  3377.         [in] HEVENT hEvent,
  3378.         [in] long Mode,
  3379.         [out] long *pStatus        // OATRUE is active, OAFALSE is inactive
  3380.     );
  3381.  
  3382.     // Selects the device's communications port, i.e.,COM1, IEEE1394, etc.
  3383.     // See edevdefs.h for enums
  3384.     HRESULT put_DevicePort([in] long DevicePort
  3385.     );
  3386.     HRESULT get_DevicePort([out] long *pDevicePort
  3387.     );
  3388.     
  3389. }
  3390. typedef IAMExtDevice *PEXTDEVICE;
  3391.  
  3392.    //---------------------------------------------------------------------
  3393.    // Defines IAMExtTransport Interface
  3394.    //
  3395.    // Contains properties and methods that control behavior of an external
  3396.    // transport device such as a VTR
  3397.    //
  3398.    // Implement if: you control such a device.  Intended to be agregated
  3399.    // with IAMExtDevice.
  3400.    //
  3401.    // Use if: you want to control such a device
  3402.    //
  3403.    // See edevdefs.h for the parameter lists
  3404.    //---------------------------------------------------------------------
  3405. [
  3406.     object,
  3407.      uuid(A03CD5F0-3045-11cf-8C44-00AA006B6814),
  3408.      pointer_default(unique)
  3409.  ]
  3410. interface IAMExtTransport : IUnknown {
  3411.  
  3412.     // General transport capabilities property.  See edevdefs.h for enums
  3413.     HRESULT GetCapability(
  3414.          [in] long Capability,        // identify the property
  3415.         [out] long *pValue,            // return value
  3416.         [out] double *pdblValue        // return value
  3417.      );
  3418.  
  3419.     // For disc-based devices: spinning, or not spinning.
  3420.     // For tape-based device: threaded, unthreaded or ejected
  3421.     HRESULT put_MediaState([in] long State
  3422.     );
  3423.     HRESULT get_MediaState([out] long *pState    // see edevdefs.h
  3424.     );
  3425.         
  3426.     // Determines state of unit's front panel
  3427.     HRESULT put_LocalControl([in] long State
  3428.     );
  3429.     HRESULT get_LocalControl([out] long *pState    // OATRUE or OAFALSE
  3430.     );
  3431.     
  3432.     // Transport status such as Play, Stop, etc.  More extensive
  3433.     // than AM states.
  3434.     HRESULT GetStatus(
  3435.         [in] long StatusItem,    // see edevdefs.h
  3436.         [out] long *pValue
  3437.     );
  3438.  
  3439.     // Parameters such as recording speed, servo reference, ballistics, etc.
  3440.     HRESULT GetTransportBasicParameters(
  3441.         [in] long Param,
  3442.         [out] long *pValue,
  3443.         [out] LPOLESTR *ppszData
  3444.     );
  3445.  
  3446.     HRESULT SetTransportBasicParameters(
  3447.         [in] long Param,
  3448.         [in] long Value,
  3449.         [in] LPCOLESTR pszData
  3450.     );
  3451.     
  3452.     // Parameters such as video output mode
  3453.     HRESULT GetTransportVideoParameters(
  3454.         [in] long Param,
  3455.         [out] long *pValue
  3456.     );
  3457.  
  3458.     HRESULT SetTransportVideoParameters(
  3459.         [in] long Param,
  3460.         [in] long Value
  3461.     );
  3462.  
  3463.     // Parameters such as audio channel enable
  3464.     HRESULT GetTransportAudioParameters(
  3465.         [in] long Param,
  3466.         [out] long *pValue
  3467.     );
  3468.  
  3469.     HRESULT SetTransportAudioParameters(
  3470.         [in] long Param,
  3471.         [in] long Value
  3472.     );
  3473.     
  3474.     // Mode is  the movement of the transport, i.e., Play, Stop,
  3475.     // Record, Edit, etc.
  3476.     HRESULT put_Mode([in] long Mode
  3477.     );
  3478.     HRESULT get_Mode([out] long *pMode
  3479.     );
  3480.  
  3481.     // Rate is for variable speed control of the the device.  This
  3482.     // can be linked to IMediaControl::Rate() in the implementation
  3483.     // if desired.
  3484.     HRESULT put_Rate([in] double dblRate
  3485.     );
  3486.     HRESULT get_Rate([out] double *pdblRate
  3487.     );
  3488.  
  3489.     // This is a lengthy method, that is, it is in effect until canceled or complete and
  3490.     // requires housekeeping by the filter.  It puts transport in play mode and maintains
  3491.     // fixed relationship between master time reference and transport position.
  3492.     HRESULT GetChase(
  3493.         [out] long *pEnabled,    // OATRUE | OAFALSE
  3494.         [out] long *pOffset,    // offset in current time format
  3495.         [out] HEVENT *phEvent    // completion notification
  3496.     );
  3497.     HRESULT SetChase(
  3498.         [in] long Enable,        // OATRUE | OAFALSE
  3499.         [in] long Offset,        // offset in current time format
  3500.         [in] HEVENT hEvent        // completion notification
  3501.     );
  3502.  
  3503.     // Also a lengthy method: temporarily change transport speed (for synchronizing).
  3504.     HRESULT GetBump(
  3505.         [out] long *pSpeed,
  3506.         [out] long *pDuration    // in current time format
  3507.     );
  3508.     HRESULT SetBump(
  3509.         [in] long Speed,
  3510.         [in] long Duration    // in current time format
  3511.     );
  3512.     
  3513.     // Enable/Disable transport anti-headclog control.
  3514.     HRESULT get_AntiClogControl([out] long *pEnabled    // OATRUE | OAFALSE
  3515.     );
  3516.     HRESULT put_AntiClogControl([in] long Enable    // OATRUE | OAFALSE
  3517.     );
  3518.     
  3519.     // The following group of properties describes edit events.  An edit event can be a
  3520.     // standard insert or assemble edit or a memorized position called a bookmark.
  3521.     // A NOTE ABOUT EVENTS: as with all lengthy commands, event objects must be created to
  3522.     // signal completion or error.
  3523.  
  3524.     // Intended usage: an edit event is prepared for use by:
  3525.     // 1. Registering an edit property set and getting an EditID
  3526.     // 2. Setting the necessary edit properties
  3527.     // 3. Setting the edit property set active
  3528.  
  3529.     // Please see edevdefs.h for properties and values
  3530.  
  3531.     // The reference clock's advance is the mechanism that puts an edit in motion (see
  3532.     // ED_EDIT_REC_INPOINT).
  3533.     
  3534.     // Property set methods
  3535.     HRESULT GetEditPropertySet(
  3536.         [in] long EditID,
  3537.         [out] long *pState    // ED_SET_ACTIVE | ED_SET_INACTIVE | ED_SET_INVALID
  3538.                             // | ED_SET_EXECUTING
  3539.     );
  3540.  
  3541.     HRESULT SetEditPropertySet(
  3542.         [in, out] long *pEditID,
  3543.         [in] long State        // ED_SET_REGISTER | ED_SET_DELETE | ED_SET_ACTIVE |
  3544.     );                        // ED_SET_INACTIVE
  3545.  
  3546.     // the following properties define an edit event such as a bookmark, seek point, or
  3547.     //  actual edit
  3548.     HRESULT GetEditProperty(
  3549.         [in] long EditID,
  3550.         [in] long Param,
  3551.         [out] long *pValue
  3552.     );
  3553.     HRESULT SetEditProperty(
  3554.         [in] long EditID,
  3555.         [in] long Param,
  3556.         [in] long Value
  3557.     );
  3558.     
  3559.     // Activates a capable transport's edit control (typically used for "on the fly" editing).
  3560.     HRESULT get_EditStart([out] long *pValue    // OATRUE or OAFALSE
  3561.     );
  3562.     HRESULT put_EditStart([in] long Value            // OATRUE or OAFALSE
  3563.     );
  3564. }
  3565. typedef IAMExtTransport *PIAMEXTTRANSPORT;
  3566.  
  3567.    //---------------------------------------------------------------------
  3568.    // Defines IAMTimecodeReader Interface
  3569.    //
  3570.    // Contains properties and methods that define behavior of a
  3571.    // SMPTE/MIDI Timecode Reader.  It is expected that this interface
  3572.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3573.    // VCR.
  3574.    //
  3575.    // Implement if: you control such a device
  3576.    //
  3577.    // Use if: you want to control such a device
  3578.    //
  3579.    // See edevdefs.h for the parameter lists
  3580.    //=====================================================================
  3581.  
  3582.  
  3583. // timecode structures
  3584. cpp_quote("#if 0")
  3585. cpp_quote("/* the following is what MIDL knows how to remote */")
  3586. typedef struct tagTIMECODE {
  3587.         WORD    wFrameRate;    // will be replaced by AM defs, but see ED_FORMAT_SMPTE for now
  3588.         WORD    wFrameFract;    // fractional frame.  full scale is always 0x1000
  3589.         DWORD    dwFrames;
  3590. }TIMECODE;
  3591. cpp_quote("#else /* 0 */")
  3592. cpp_quote("#ifndef TIMECODE_DEFINED")
  3593. cpp_quote("#define TIMECODE_DEFINED")
  3594. cpp_quote("typedef union _timecode {")
  3595. cpp_quote("   struct {")
  3596. cpp_quote("     WORD   wFrameRate;")
  3597. cpp_quote("     WORD   wFrameFract;")
  3598. cpp_quote("     DWORD  dwFrames;")
  3599. cpp_quote("     };")
  3600. cpp_quote("   DWORDLONG  qw;")
  3601. cpp_quote("   } TIMECODE;")
  3602. cpp_quote("")
  3603. cpp_quote("#endif /* TIMECODE_DEFINED */")
  3604. cpp_quote("#endif /* 0 */")
  3605.  
  3606. typedef TIMECODE *PTIMECODE;
  3607.  
  3608. typedef struct tagTIMECODE_SAMPLE {
  3609.     LONGLONG    qwTick;        // ActiveMovie 100ns timestamp
  3610.     TIMECODE    timecode;    // timecode
  3611.     DWORD        dwUser;        // timecode user data (aka user bits)
  3612.     DWORD        dwFlags;       // timecode flags - see below
  3613. } TIMECODE_SAMPLE;
  3614. typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE;
  3615.  
  3616.  
  3617. [
  3618.     object,
  3619.      uuid(9B496CE1-811B-11cf-8C77-00AA006B6814),
  3620.      pointer_default(unique)
  3621. ]
  3622. interface IAMTimecodeReader : IUnknown
  3623. {
  3624.     // Timecode Reader Mode - gets/sets the following properties
  3625.     // ED_TCR_SOURCE - timecode gen (readback), LTC, VITC, or Control Track
  3626.     HRESULT GetTCRMode(
  3627.         [in] long Param,
  3628.         [out] long *pValue);
  3629.     HRESULT SetTCRMode(
  3630.         [in] long Param,
  3631.         [in] long Value);
  3632.     
  3633.     // Select which line of the vertical interval timecode will be read from (if VITC).
  3634.     // To read VITC on specific multiple lines, the caller would make successive calls to
  3635.     // put_VITCLine(), once for each line desired.
  3636.     HRESULT put_VITCLine(
  3637.         [in] long Line );    // valid lines are 11-20, 0 means autoselect,
  3638.                             // hi bit set means add to list of lines (for
  3639.                             // readers that test across multiple lines)
  3640.     HRESULT get_VITCLine(
  3641.         [out] long *pLine ); // hi bit set means multiple lines are used,
  3642.                             // and successive calls will cycle through the
  3643.                             // line numbers (like an enumerator, only simpler)
  3644.  
  3645.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3646.     // stream. The client can use this to monitor the timecode, parse duplicates and
  3647.     // discontinuities. The source filter supplying the timecode or possibly a down stream
  3648.     // filter might want to parse for discontinuities or errors since you have to look at
  3649.     // every sample to do this properly.
  3650.     //
  3651.  
  3652.     HRESULT GetTimecode(
  3653.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3654.  
  3655. }
  3656. typedef IAMTimecodeReader *PIAMTIMECODEREADER;
  3657.  
  3658.    //---------------------------------------------------------------------
  3659.    //=====================================================================
  3660.    // Defines IAMTimecodeGenerator Interface
  3661.    //
  3662.    // Contains properties and methods that define behavior of an external
  3663.    // SMPTE/MIDI Timecode Generator.  It is expected that this interface
  3664.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3665.    // VCR.
  3666.    //
  3667.    // Implement if: you control such a device
  3668.    //
  3669.    // Use if: you want to control such a device
  3670.    //
  3671.    // See edevdefs.h for the parameter lists
  3672.     //---------------------------------------------------------------------
  3673. [
  3674.     object,
  3675.      uuid(9B496CE0-811B-11cf-8C77-00AA006B6814),
  3676.      pointer_default(unique)
  3677.  ]
  3678. interface IAMTimecodeGenerator : IUnknown {
  3679.  
  3680.     // Timecode Generator Mode - gets/sets the following properties (see
  3681.     // vcrdefss.h for detailed values):
  3682.     // ED_TCG_TIMECODE_TYPE - LTC, VITC, or MIDI
  3683.     // ED_TCG_FRAMERATE - 24, 25, 30 drop or 30 nondrop
  3684.     // ED_TCG_SYNC_SOURCE - what is driving the bitclock
  3685.     // ED_TCG_REFERENCE_SOURCE - what is driving the count value
  3686.     HRESULT GetTCGMode(
  3687.         [in] long Param,
  3688.         [out] long *pValue);
  3689.  
  3690.     HRESULT SetTCGMode(
  3691.         [in] long Param,
  3692.         [in] long Value);
  3693.  
  3694.     // Select into which line(s) of the vertical interval timecode will be inserted (if VITC).
  3695.     // Hi bit set means add this line to any previously set lines.
  3696.     // To generate VITC on specific multiple lines, the caller would make successive calls to
  3697.     // put_VITCLine(), once for each line desired.
  3698.     HRESULT put_VITCLine(
  3699.         [in] long Line        // valid lines are 11-20, 0 means autoselect(this setting
  3700.     );                        // is for TC readers that decode from multiple lines)
  3701.     HRESULT get_VITCLine(
  3702.         [out] long *pLine
  3703.     );
  3704.  
  3705.     // Sets timecode and/or userbit value.  If generator is running, takes effect
  3706.     // immediately.  If caller wants to set only timecode, set userbit value to -1L (and
  3707.     // same for setting userbits only)
  3708.     //
  3709.  
  3710.     HRESULT SetTimecode(
  3711.       [in] PTIMECODE_SAMPLE pTimecodeSample) ;
  3712.  
  3713.  
  3714.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3715.     // stream. The client can use this to monitor the timecode and verify the generator is
  3716.     // working properly
  3717.     //
  3718.  
  3719.     HRESULT GetTimecode(
  3720.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3721.  
  3722. }
  3723. typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR;
  3724.  
  3725.     //---------------------------------------------------------------------
  3726.    // Defines IAMTimecodeDisplay Interface
  3727.    //
  3728.    // Contains properties and methods that define behavior of an external
  3729.    // SMPTE/MIDI Timecode Display device (aka "character generator" for
  3730.    // making "burn-ins" or "window dubs"). It is expected that this interface
  3731.    // will be combined (aggregated) with IAMExtTransport and the timecode
  3732.    // interfaces to "build" a pro VCR.
  3733.    //
  3734.    // Implement if: you control such a device
  3735.    //
  3736.    // Use if: you want to control such a device
  3737.    //
  3738.    // See edevdefs.h for the parameter lists
  3739.     //---------------------------------------------------------------------
  3740. [
  3741.     object,
  3742.      uuid(9B496CE2-811B-11cf-8C77-00AA006B6814),
  3743.      pointer_default(unique)
  3744.  ]
  3745. interface IAMTimecodeDisplay : IUnknown
  3746. {
  3747.     // Enable/disable external device's timecode reader's character generator output.  Some
  3748.     // readers have this feature - this is not intended for rendering inside the PC!
  3749.     HRESULT GetTCDisplayEnable(
  3750.         [out] long *pState);    // OATRUE | OAFALSE
  3751.     HRESULT SetTCDisplayEnable(
  3752.         [in] long State);        // OATRUE | OAFALSE
  3753.                                 // Timecode reader's character generator output
  3754.                                 //  characteristics (size, position, intensity, etc.).
  3755.     HRESULT GetTCDisplay(
  3756.         [in] long Param,
  3757.         [out] long *pValue);
  3758.     HRESULT SetTCDisplay(
  3759.         [in] long Param,
  3760.         [in] long Value);
  3761.  
  3762.     /* Allowable params and values (see edevdefs.h for details):
  3763.         ED_TCD_SOURCE
  3764.             ED_TCR | ED_TCG
  3765.         ED_TCD_SIZE
  3766.             ED_SMALL | ED_MED | ED_LARGE
  3767.         ED_TCD_POSITION
  3768.             ED_TOP | ED_MIDDLE | ED_BOTTOM or'd  with
  3769.             ED_LEFT | ED_CENTER | ED_RIGHT
  3770.         ED_TCD_INTENSITY
  3771.             ED_HIGH | ED_LOW
  3772.         ED_TCD_TRANSPARENCY    // set from 0 to 4, 0 being completely opaque
  3773.         ED_TCD_INVERT        // white on black or black on white
  3774.             OATRUE | OAFALSE
  3775.         ED_TCD_BORDER        // white border for black chars, black border for white letters
  3776.             OATRUE | OAFALSE
  3777.     */
  3778. }
  3779. typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY;
  3780.  
  3781.  
  3782. [
  3783.     object,
  3784.     uuid(c6545bf0-e76b-11d0-bd52-00a0c911ce86),
  3785.     pointer_default(unique)
  3786. ]
  3787. interface IAMDevMemoryAllocator : IUnknown
  3788. {
  3789.     HRESULT GetInfo(
  3790.         [out] DWORD *pdwcbTotalFree,
  3791.         [out] DWORD *pdwcbLargestFree,
  3792.         [out] DWORD *pdwcbTotalMemory,
  3793.         [out] DWORD *pdwcbMinimumChunk);
  3794.  
  3795.     HRESULT CheckMemory(
  3796.         [in] const BYTE *pBuffer);
  3797.  
  3798.     HRESULT Alloc(
  3799.         [out] BYTE **ppBuffer,
  3800.         [in, out] DWORD *pdwcbBuffer);
  3801.  
  3802.     HRESULT Free(
  3803.         [in] BYTE *pBuffer);
  3804.  
  3805.     HRESULT GetDevMemoryObject(
  3806.         [out] IUnknown **ppUnkInnner,
  3807.         [in] IUnknown *pUnkOuter);
  3808. }
  3809. typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR;
  3810.  
  3811.  
  3812. [
  3813.     object,
  3814.     uuid(c6545bf1-e76b-11d0-bd52-00a0c911ce86),
  3815.     pointer_default(unique)
  3816. ]
  3817. interface IAMDevMemoryControl : IUnknown
  3818. {
  3819.     HRESULT QueryWriteSync();
  3820.  
  3821.     HRESULT WriteSync();
  3822.  
  3823.     HRESULT GetDevId(
  3824.         [out] DWORD *pdwDevId);
  3825.  
  3826. }
  3827. typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL;
  3828.  
  3829. //  Flags for IAMStreamSelection::Info
  3830. enum _AMSTREAMSELECTINFOFLAGS {
  3831.     AMSTREAMSELECTINFO_ENABLED   = 0x01,  // Enable - off for disable
  3832.     AMSTREAMSELECTINFO_EXCLUSIVE = 0x02   // Turns off the others in the group
  3833.                                           // when enabling this one
  3834. };
  3835. //  Flags for IAMStreamSelection::Enable
  3836. enum _AMSTREAMSELECTENABLEFLAGS {
  3837.     //  Currently valid values are :
  3838.     //  0 - disable all streams in the group containing this stream
  3839.     //  ..._ENABLE - enable only this stream with in the given group
  3840.     //               and disable all others
  3841.     //  ..._ENABLEALL - send out all streams
  3842.     AMSTREAMSELECTENABLE_ENABLE    = 0x01,  // Enable
  3843.     AMSTREAMSELECTENABLE_ENABLEALL = 0x02   // Enable all streams in the group
  3844.                                             // containing this stream
  3845. };
  3846.  
  3847. //  Control which logical streams are played and find out information about
  3848. //  them
  3849. //  Normally supported by a filter
  3850. [
  3851.     object,
  3852.     uuid(c1960960-17f5-11d1-abe1-00a0c905f375),
  3853.     pointer_default(unique)
  3854. ]
  3855. interface IAMStreamSelect : IUnknown
  3856. {
  3857.     //  Returns total count of streams
  3858.     HRESULT Count(
  3859.         [out] DWORD *pcStreams);      // Count of logical streams
  3860.  
  3861.     //  Return info for a given stream - S_FALSE if iIndex out of range
  3862.     //  The first steam in each group is the default
  3863.     HRESULT Info(
  3864.         [in] long lIndex,              // 0-based index
  3865.         [out] AM_MEDIA_TYPE **ppmt,   // Media type - optional
  3866.                                       // Use DeleteMediaType to free
  3867.         [out] DWORD *pdwFlags,        // flags - optional
  3868.         [out] LCID  *plcid,           // LCID (returns 0 if none) - optional
  3869.         [out] DWORD *pdwGroup,        // Logical group - optional
  3870.         [out] WCHAR **ppszName,       // Name - optional - free with CoTaskMemFree
  3871.                                       // optional
  3872.         [out] IUnknown **ppObject,    // Associated object - optional
  3873.                                       // Object may change if Enable is
  3874.                                       // called on this interface
  3875.                                       // - returns NULL if no associated object
  3876.                                       // Returns pin or filter for DShow
  3877.         [out] IUnknown **ppUnk);      // Stream specific interface
  3878.  
  3879.     //  Enable or disable a given stream
  3880.     HRESULT Enable(
  3881.         [in]  long lIndex,
  3882.         [in]  DWORD dwFlags);
  3883. }
  3884. typedef IAMStreamSelect *PAMSTREAMSELECT;
  3885.  
  3886. enum _AMRESCTL_RESERVEFLAGS
  3887. {
  3888.     AMRESCTL_RESERVEFLAGS_RESERVE     = 0x00,  // Increment reserve count
  3889.     AMRESCTL_RESERVEFLAGS_UNRESERVE   = 0x01   // Decrement reserve count
  3890. };
  3891.  
  3892. //  Reserve resources now so that playback can be subsequently
  3893. //  guaranteed
  3894. //
  3895. //  Normally supported by a filter
  3896. //
  3897. [
  3898.     object,
  3899.     uuid(8389d2d0-77d7-11d1-abe6-00a0c905f375),
  3900.     pointer_default(unique),
  3901.     local
  3902. ]
  3903. interface IAMResourceControl : IUnknown
  3904. {
  3905.     //  The reserve count is incremented/decremented if and only if
  3906.     //  S_OK is returned
  3907.     //  Unreserve once for every Reserve call
  3908.     HRESULT Reserve(
  3909.         [in] DWORD dwFlags,          //  From _AMRESCTL_RESERVEFLAGS enum
  3910.         [in] PVOID pvReserved        //  Must be NULL
  3911.     );
  3912. }
  3913.  
  3914.  
  3915. //  Set clock adjustments - supported by some clocks
  3916. [
  3917.     object,
  3918.     uuid(4d5466b0-a49c-11d1-abe8-00a0c905f375),
  3919.     pointer_default(unique),
  3920.     local
  3921. ]
  3922. interface IAMClockAdjust : IUnknown
  3923. {
  3924.     //  Set the following delta to clock times
  3925.     //  The clock will add adjust its times by the given delta
  3926.     HRESULT SetClockDelta(
  3927.         [in] REFERENCE_TIME rtDelta
  3928.     );
  3929. };
  3930.  
  3931. //  Filter miscellaneous status flags
  3932.  
  3933. enum _AM_FILTER_MISC_FLAGS {
  3934.     AM_FILTER_MISC_FLAGS_IS_RENDERER = 0x00000001, /* Will deliver EC_COMPLETE
  3935.                                                      at end of media */
  3936.     AM_FILTER_MISC_FLAGS_IS_SOURCE   = 0x00000002  /*  Filter sources data */
  3937. };
  3938.  
  3939. [
  3940.     object,
  3941.     uuid(2dd74950-a890-11d1-abe8-00a0c905f375),
  3942.     pointer_default(unique),
  3943.     local
  3944. ]
  3945. interface IAMFilterMiscFlags : IUnknown
  3946. {
  3947.     //  Get miscellaneous property flags
  3948.     ULONG GetMiscFlags(void);
  3949. };
  3950.  
  3951.  
  3952. // Video Image drawing interface
  3953. [
  3954.     object,
  3955.     local,
  3956.     uuid(48efb120-ab49-11d2-aed2-00a0c995e8d5),
  3957.     pointer_default(unique),
  3958. ]
  3959. interface IDrawVideoImage : IUnknown
  3960. {
  3961.     HRESULT DrawVideoImageBegin();
  3962.  
  3963.     HRESULT DrawVideoImageEnd();
  3964.  
  3965.     HRESULT DrawVideoImageDraw(
  3966.         [in] HDC hdc,
  3967.         [in] LPRECT lprcSrc,
  3968.         [in] LPRECT lprcDst
  3969.     );
  3970. }
  3971.  
  3972. //
  3973. // Video Image decimation interface
  3974. //
  3975. // The aim of this interface is to enable a video renderer filter to
  3976. // control the decimation properties of a video decoder connected to
  3977. // the video renderer
  3978. //
  3979. // This interface should only be supported by decoders that are capable of
  3980. // decimating their output image by an arbitary amount.
  3981. //
  3982. //
  3983. [
  3984.     object,
  3985.     local,
  3986.     uuid(2e5ea3e0-e924-11d2-b6da-00a0c995e8df),
  3987.     pointer_default(unique),
  3988. ]
  3989. interface IDecimateVideoImage : IUnknown
  3990. {
  3991.     //
  3992.     // Informs the decoder that it should decimate its output
  3993.     // image to the specified width and height.  If the decoder can
  3994.     // decimate to this size it should return S_OK.
  3995.     // If the decoder can't perform the requested decimation
  3996.     // or wants to stop performing the decimation that it is
  3997.     // currently doing it should return E_FAIL.
  3998.     //
  3999.     HRESULT SetDecimationImageSize(
  4000.         [in] long lWidth,
  4001.         [in] long lHeight);
  4002.  
  4003.     //
  4004.     // Informs the decoder that it should stop decimating its output image
  4005.     // and resume normal output.
  4006.     //
  4007.     HRESULT ResetDecimationImageSize();
  4008. }
  4009.  
  4010. typedef enum _DECIMATION_USAGE {
  4011.     DECIMATION_LEGACY,              // decimate at ovly then video port then crop
  4012.     DECIMATION_USE_DECODER_ONLY,    // decimate image at the decoder only
  4013.     DECIMATION_USE_VIDEOPORT_ONLY,  // decimate at the video port only
  4014.     DECIMATION_USE_OVERLAY_ONLY,    // decimate at the overlay only
  4015.     DECIMATION_DEFAULT              // decimate at decoder then ovly the vide port then crop
  4016. } DECIMATION_USAGE;
  4017.  
  4018. [
  4019.     object,
  4020.     local,
  4021.     uuid(60d32930-13da-11d3-9ec6-c4fcaef5c7be),
  4022.     pointer_default(unique),
  4023. ]
  4024. interface IAMVideoDecimationProperties: IUnknown
  4025. {
  4026.     //
  4027.     // Queries the current usage of the above IDecimateVideoImage
  4028.     // interface.
  4029.     //
  4030.     HRESULT QueryDecimationUsage(
  4031.         [out] DECIMATION_USAGE* lpUsage);       // from DECIMATION_USAGE enum
  4032.  
  4033.     //
  4034.     // Sets the current usage of the above IDecimateVideoImage
  4035.     // interface.
  4036.     //
  4037.     HRESULT SetDecimationUsage(
  4038.         [in] DECIMATION_USAGE Usage);           // from DECIMATION_USAGE enum
  4039. }
  4040.  
  4041. //---------------------------------------------------------------------
  4042. //
  4043. // IVideoFrameStep interface
  4044. //
  4045. //---------------------------------------------------------------------
  4046.  
  4047. [
  4048.     object,
  4049.     uuid(e46a9787-2b71-444d-a4b5-1fab7b708d6a),
  4050.     pointer_default(unique),
  4051. ]
  4052. interface IVideoFrameStep : IUnknown
  4053. {
  4054.     //
  4055.     //  Stop(), Pause(), Run() all cancel Step as does any seeking
  4056.     //  request.
  4057.     //
  4058.     //  The Step() and CancelStep() methods of this interface
  4059.     //  Cancel any previous step.
  4060.     //
  4061.     //  When stepping is complete EC_STEP_COMPLETE is signalled.
  4062.     //
  4063.     //  When the filter graph gets EC_STEP_COMPLETE it automatically
  4064.     //  sets the filter graph into paused state and forwards the
  4065.     //  notification to the application
  4066.     //
  4067.     //  Returns S_OK if stepping initiated.
  4068.     //
  4069.     //  dwFrames
  4070.     //    1 means step 1 frame forward
  4071.     //    0 is invalid
  4072.     //    n (n > 1) means skip n - 1 frames and show the nth
  4073.     //
  4074.     //  pStepObject
  4075.     //    NULL - default step object (filter) picked
  4076.     //    non-NULL - use this object for stepping
  4077.     //
  4078.     HRESULT Step(DWORD dwFrames, [unique] IUnknown *pStepObject);
  4079.  
  4080.     //  Can step?
  4081.     //  Returns S_OK if it can, S_FALSE if it can't or error code.
  4082.     //  bMultiple - if TRUE return whether can step n > 1
  4083.     HRESULT CanStep(long bMultiple, [unique] IUnknown *pStepObject);
  4084.  
  4085.     //  Cancel stepping
  4086.     HRESULT CancelStep();
  4087. }
  4088.  
  4089.  
  4090.  
  4091.  
  4092. //---------------------------------------------------------------------
  4093. //
  4094. // IAMPushSource interface
  4095. //
  4096. // Provides a means for source filters to describe information about the
  4097. // data that they source, such as whether the data is live or not, and
  4098. // what type of clock was used for timestamps. This information may be
  4099. // needed by other clocks in the graph in order to provide accurate
  4100. // synchronization. Also provides a way to specify an offset value for
  4101. // the filter to use when timestamping the streams it sources. Provides
  4102. // support for the IAMLatency interface as well.
  4103. //
  4104. //---------------------------------------------------------------------
  4105.  
  4106. enum _AM_PUSHSOURCE_FLAGS {
  4107.  
  4108.     //
  4109.     // The default assumption is that the data is from a live source,
  4110.     // time stamped with the graph clock, and the source does not
  4111.     // attempt to rate match the data it delivers.
  4112.     // The following flags can be used to override this assumption.
  4113.     //
  4114.  
  4115.     // capability flags
  4116.     AM_PUSHSOURCECAPS_INTERNAL_RM        = 0x00000001,  // source provides internal support for rate matching
  4117.     AM_PUSHSOURCECAPS_NOT_LIVE           = 0x00000002,  // don't treat source data as live
  4118.     AM_PUSHSOURCECAPS_PRIVATE_CLOCK      = 0x00000004,  // source data timestamped with clock not
  4119.                                                         // exposed to the graph
  4120.  
  4121.     // request flags, set by user via SetPushSourceFlags method
  4122.     AM_PUSHSOURCEREQS_USE_STREAM_CLOCK   = 0x00010000,  // source was requested to timestamp
  4123.                                                         // using a clock that isn't the graph clock
  4124.  
  4125.     AM_PUSHSOURCEREQS_USE_CLOCK_CHAIN    = 0x00020000,  // source requests reference clock chaining
  4126. };
  4127.  
  4128. //
  4129. // Used to set a source filter to run in a "live" mode.
  4130. //
  4131. [
  4132. object,
  4133.     uuid(F185FE76-E64E-11d2-B76E-00C04FB6BD3D),
  4134.     pointer_default(unique)
  4135. ]
  4136. interface IAMPushSource : IAMLatency
  4137. {
  4138.     // used to discover push source's capabilities.
  4139.     // may be any combination of the AM_PUSHSOURCE_FLAGS flags.
  4140.     HRESULT GetPushSourceFlags (
  4141.         [out] ULONG *pFlags
  4142.     );
  4143.  
  4144.     // used to set request flags for a push source.
  4145.     // may be a combination of the AM_PUSHSOURCE_REQS_xxx flags.
  4146.     HRESULT SetPushSourceFlags (
  4147.         [in]  ULONG Flags
  4148.     );
  4149.  
  4150.     // specify an offset for push source time stamps
  4151.     HRESULT SetStreamOffset (
  4152.         [in]  REFERENCE_TIME  rtOffset
  4153.     );
  4154.  
  4155.     // retrieve the offset this push source is using
  4156.     HRESULT GetStreamOffset (
  4157.         [out] REFERENCE_TIME  *prtOffset
  4158.     );
  4159.  
  4160.     // retrieve the maximum stream offset this push source thinks it can support
  4161.     HRESULT GetMaxStreamOffset (
  4162.         [out] REFERENCE_TIME  *prtMaxOffset
  4163.     );
  4164.  
  4165.     // allows the filter graph to tell a push source the maximum latency allowed on the graph
  4166.     // this allows pins like the video capture preview pin to be more efficient with the amount
  4167.     // of buffering required to support the maximum graph latency
  4168.     HRESULT SetMaxStreamOffset (
  4169.         [in] REFERENCE_TIME  rtMaxOffset
  4170.     );
  4171. };
  4172.  
  4173.  
  4174. // ------------------------------------------------------------------------
  4175. //
  4176. // IAMDeviceRemoval interface
  4177. //
  4178. // Implemented by filters to request and receive WM_DEVICECHANGE
  4179. // notifications
  4180. //
  4181. // ------------------------------------------------------------------------
  4182.  
  4183. [
  4184.         object,
  4185.         uuid(f90a6130-b658-11d2-ae49-0000f8754b99),
  4186.         pointer_default(unique)
  4187. ]
  4188. interface IAMDeviceRemoval : IUnknown
  4189. {
  4190.  
  4191.     HRESULT DeviceInfo(
  4192.         [out] CLSID *pclsidInterfaceClass,
  4193.         [out] WCHAR **pwszSymbolicLink);
  4194.  
  4195.     HRESULT Reassociate();
  4196.  
  4197.     HRESULT Disassociate();
  4198. }
  4199.  
  4200. //
  4201. // for DV
  4202. //
  4203. typedef struct {
  4204.     //for 1st 5/6 DIF seq.
  4205.     DWORD dwDVAAuxSrc;
  4206.     DWORD dwDVAAuxCtl;
  4207.     //for 2nd  5/6 DIF seq.
  4208.     DWORD dwDVAAuxSrc1;
  4209.     DWORD dwDVAAuxCtl1;
  4210.     //for video information
  4211.     DWORD dwDVVAuxSrc;
  4212.     DWORD dwDVVAuxCtl;
  4213.     DWORD dwDVReserved[2];
  4214.  
  4215. } DVINFO, *PDVINFO;
  4216.  
  4217. // ------------------------------------------------------------------------
  4218. //
  4219. // IDVEnc interface
  4220. //
  4221. // Implemented by DV encoder filters to set Encoder format
  4222. //
  4223. // ------------------------------------------------------------------------
  4224. enum _DVENCODERRESOLUTION {            //resolution
  4225.     DVENCODERRESOLUTION_720x480     =   2012,
  4226.     DVENCODERRESOLUTION_360x240     =   2013,
  4227.     DVENCODERRESOLUTION_180x120     =   2014,
  4228.     DVENCODERRESOLUTION_88x60       =   2015
  4229. };
  4230. enum _DVENCODERVIDEOFORMAT {        //PAL/ntsc
  4231.     DVENCODERVIDEOFORMAT_NTSC        =    2000,
  4232.     DVENCODERVIDEOFORMAT_PAL            =    2001
  4233. };
  4234. enum _DVENCODERFORMAT {        // dvsd/dvhd/dvsl
  4235.     DVENCODERFORMAT_DVSD        =    2007,
  4236.     DVENCODERFORMAT_DVHD        =    2008,
  4237.     DVENCODERFORMAT_DVSL        =    2009
  4238. };
  4239. [
  4240.         object,
  4241.         uuid(d18e17a0-aacb-11d0-afb0-00aa00b67a42),
  4242.         pointer_default(unique)
  4243. ]
  4244. interface IDVEnc : IUnknown
  4245. {
  4246.  
  4247.     HRESULT get_IFormatResolution (
  4248.         [out] int *VideoFormat,    //pal or ntsc
  4249.         [out] int *DVFormat,        //dvsd dvhd dvsl
  4250.         [out] int *Resolution,        //720, 360, 180,88
  4251.         [in]  BYTE fDVInfo,        //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO
  4252.         [out] DVINFO *sDVInfo        //NULL if fDVInfo=FALSE,
  4253.     );
  4254.  
  4255.    HRESULT put_IFormatResolution (
  4256.         [in] int VideoFormat,
  4257.         [in] int DVFormat,
  4258.         [in] int Resolution,    
  4259.         [in] BYTE fDVInfo,        //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO
  4260.         [in] DVINFO *sDVInfo        //NULL if fDVInfo=FALSE,
  4261.     );
  4262.  
  4263. }
  4264.  
  4265. // ------------------------------------------------------------------------
  4266. //
  4267. // IDVDec interface
  4268. //
  4269. // Implemented by DV decoder filters to set decoder size
  4270. //
  4271. // ------------------------------------------------------------------------
  4272. enum _DVDECODERRESOLUTION {
  4273.     DVDECODERRESOLUTION_720x480     =   1000,
  4274.     DVDECODERRESOLUTION_360x240     =   1001,
  4275.     DVDECODERRESOLUTION_180x120     =   1002,
  4276.     DVDECODERRESOLUTION_88x60       =   1003
  4277. };
  4278. enum _DVRESOLUTION {
  4279.     DVRESOLUTION_FULL        =    1000,
  4280.     DVRESOLUTION_HALF        =    1001,
  4281.     DVRESOLUTION_QUARTER        =    1002,
  4282.     DVRESOLUTION_DC            =    1003
  4283. };
  4284. [
  4285.         object,
  4286.         uuid(b8e8bd60-0bfe-11d0-af91-00aa00b67a42),
  4287.         pointer_default(unique)
  4288. ]
  4289. interface IIPDVDec : IUnknown
  4290. {
  4291.     HRESULT get_IPDisplay (
  4292.             [out] int *displayPix        // The display pixels arrage
  4293.                  );
  4294.  
  4295.     HRESULT put_IPDisplay (
  4296.              [in] int displayPix            // Change to this display pixel arrage
  4297.                  ) ;
  4298. }
  4299.  
  4300. //------------------------------------------------------------------------
  4301. //
  4302. // IDVRGB219 interface
  4303. //
  4304. // Implemented by both the DV encoder and decoder filters
  4305. // Used for enabling the 219 mode in which the Range of RGB24 either received
  4306. // by the encoder or produced by the decoder becomes (16,16,16)--(235,235,235)
  4307. // instead of (0,0,0)--(255,255,255).
  4308. // The interface's method has no effect in case of any other color space than
  4309. // RGB 24
  4310. //
  4311. //------------------------------------------------------------------------
  4312.  
  4313. [
  4314.         object,
  4315.         uuid(58473A19-2BC8-4663-8012-25F81BABDDD1),
  4316.         pointer_default(unique)
  4317. ]
  4318. interface IDVRGB219 : IUnknown
  4319. {
  4320.     HRESULT SetRGB219 ([in] BOOL bState);   // State = True   Turn 219 mode on else turn it off.
  4321. }
  4322.  
  4323.  
  4324. // ------------------------------------------------------------------------
  4325. //
  4326. // IDVSplitter interface
  4327. //
  4328. // Implemented by DV splitter filters
  4329. //
  4330. // ------------------------------------------------------------------------
  4331. [
  4332.     object,
  4333.     uuid(92a3a302-da7c-4a1f-ba7e-1802bb5d2d02)
  4334. ]
  4335. interface IDVSplitter : IUnknown
  4336. {
  4337.     HRESULT DiscardAlternateVideoFrames(
  4338.             [in] int nDiscard
  4339.                  ) ;
  4340. }
  4341.  
  4342. //  Audio Renderer statistics params for IAMAudioRendererStats interface
  4343. enum _AM_AUDIO_RENDERER_STAT_PARAM {
  4344.     AM_AUDREND_STAT_PARAM_BREAK_COUNT = 1,     // audio breaks
  4345.     AM_AUDREND_STAT_PARAM_SLAVE_MODE,          // current slave mode, see AM_AUDREND_SLAVE_MODEs
  4346.     AM_AUDREND_STAT_PARAM_SILENCE_DUR,         // silence inserted due to gaps (ms)
  4347.     AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR,     // duration of the last buffer received
  4348.     AM_AUDREND_STAT_PARAM_DISCONTINUITIES,     // discontinuities seen since running
  4349.     AM_AUDREND_STAT_PARAM_SLAVE_RATE,          // what rate are we currently slaving at? S_FALSE if not slaving
  4350.     AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR, // for waveOut slaving - data dropped or added to stay in-sync
  4351.                                                //       dwParam1 - dropped duration(ms)
  4352.                                                //       dwParam2 - paused duration(ms)
  4353.     AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR,  // highest & lowest clock differences seen
  4354.                                                //       dwParam1 - high err
  4355.                                                //       dwParam2 - low err
  4356.     AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR, // last high and low errs seen
  4357.                                                //       dwParam1 - last high err
  4358.                                                //       dwParam2 - last low err
  4359.     AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR,    // error between master/slave clocks
  4360.     AM_AUDREND_STAT_PARAM_BUFFERFULLNESS,      // percent audio buffer fullness
  4361.     AM_AUDREND_STAT_PARAM_JITTER               // input buffer jitter
  4362. };
  4363.  
  4364. //---------------------------------------------------------------------
  4365. //
  4366. // IAMAudioRendererStats interface
  4367. //
  4368. // Interface to get at statistical information that is optionally stored
  4369. // in an audio renderer filter. Supported on the filter interface (although
  4370. // this might be better for ksproxy if we define it as a pin interface?)
  4371. //
  4372. //---------------------------------------------------------------------
  4373.  
  4374. [
  4375. object,
  4376.     uuid(22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93),
  4377.     pointer_default(unique)
  4378. ]
  4379. interface IAMAudioRendererStats : IUnknown
  4380. {
  4381.     // Get value corresponding to the passed in parameter id
  4382.     HRESULT GetStatParam(
  4383.         [in]   DWORD     dwParam,
  4384.         [out]  DWORD     *pdwParam1,
  4385.         [out]  DWORD     *pdwParam2
  4386.     );
  4387. }
  4388.  
  4389. //---------------------------------------------------------------------
  4390. //
  4391. // IAMLatency interface
  4392. //
  4393. // Allows a filter to report the expected latency associated with a data
  4394. // stream flowing from its input to output pin. Supported on output pins.
  4395. //
  4396. //---------------------------------------------------------------------
  4397.  
  4398. [
  4399. object,
  4400.     uuid(62EA93BA-EC62-11d2-B770-00C04FB6BD3D),
  4401.     pointer_default(unique)
  4402. ]
  4403. interface IAMLatency : IUnknown
  4404. {
  4405.     HRESULT GetLatency(
  4406.         [in]   REFERENCE_TIME  *prtLatency
  4407.     );
  4408. }
  4409.  
  4410.  
  4411. enum _AM_INTF_SEARCH_FLAGS {
  4412.     AM_INTF_SEARCH_INPUT_PIN  = 0x00000001,   // search input pins
  4413.     AM_INTF_SEARCH_OUTPUT_PIN = 0x00000002,   // search output pins
  4414.     AM_INTF_SEARCH_FILTER     = 0x00000004    // search filters
  4415. };
  4416.  
  4417. //---------------------------------------------------------------------
  4418. //
  4419. // IAMGraphStreams interface
  4420. //
  4421. // Interface used to control or search over connected streams of data
  4422. // flow within a filter graph.
  4423. //
  4424. //---------------------------------------------------------------------
  4425.  
  4426. [
  4427. object,
  4428.     uuid(632105FA-072E-11d3-8AF9-00C04FB6BD3D),
  4429.     pointer_default(unique)
  4430. ]
  4431. interface IAMGraphStreams : IUnknown
  4432. {
  4433.     // Search upstream from the current pin, for the specified interface.
  4434.     // dwFlags can be any combination of the AM_INTF_SEARCH_FLAGS, and allows
  4435.     // control over what objects to search. A value of 0 means to search all.
  4436.     HRESULT FindUpstreamInterface(
  4437.         [in]                IPin *pPin,
  4438.         [in]                REFIID riid,
  4439.         [out, iid_is(riid)] void **ppvInterface,
  4440.         [in]                DWORD dwFlags );
  4441.  
  4442.     // Enable or disable the graph's setting of a timestamp offset
  4443.     // on push sources.
  4444.     HRESULT SyncUsingStreamOffset( [in] BOOL bUseStreamOffset );
  4445.  
  4446.     // allow an app to set the maximum offset used on push source filters
  4447.     HRESULT SetMaxGraphLatency( [in] REFERENCE_TIME rtMaxGraphLatency );
  4448. }
  4449.  
  4450.  
  4451. //
  4452. // IAMOverlayFX
  4453. //
  4454. // This interface is exposed by the overlay mixer filter and allows
  4455. // an application to apply various "effects" to the overlay surface
  4456. // used by the overlay mixer.
  4457. //
  4458. // The effects that can be applied are described by the AMOVERLAYFX
  4459. // enumeration.
  4460. //
  4461. enum AMOVERLAYFX {
  4462.     // Normal (ie. top down, left to right) video
  4463.     AMOVERFX_NOFX =             0x00000000,
  4464.  
  4465.     // Mirror the overlay across the vertical axis
  4466.     AMOVERFX_MIRRORLEFTRIGHT =  0x00000002,
  4467.  
  4468.      // Mirror the overlay across the horizontal axis
  4469.     AMOVERFX_MIRRORUPDOWN =     0x00000004,
  4470.  
  4471.     // Deinterlace the overlay, if possible
  4472.     AMOVERFX_DEINTERLACE =      0x00000008
  4473. };
  4474.  
  4475. [
  4476. object,
  4477.     uuid(62fae250-7e65-4460-bfc9-6398b322073c),
  4478.     pointer_default(unique)
  4479. ]
  4480. interface IAMOverlayFX : IUnknown
  4481. {
  4482.     // Use this method to determine what overlay effects are currently available
  4483.     // for the overlay surface used by the overlay mixer filter.
  4484.     //
  4485.     HRESULT QueryOverlayFXCaps(
  4486.         [out] DWORD *lpdwOverlayFXCaps
  4487.         );
  4488.  
  4489.     // Use this method to apply a new overlay effect to the overlay surface
  4490.     // used by the overlay mixer filter.  This method can be called while the
  4491.     // filter graph is running, the effect is applied immediately
  4492.     //
  4493.     HRESULT SetOverlayFX(
  4494.         [in] DWORD dwOverlayFX
  4495.         );
  4496.  
  4497.     // Use this method to determine what effect (if any) is currently being
  4498.     // applied to the overlay surface by the overlay mixer filter.
  4499.     //
  4500.     HRESULT GetOverlayFX(
  4501.         [out] DWORD *lpdwOverlayFX
  4502.         );
  4503. }    
  4504.  
  4505.  
  4506.  
  4507. // IAMOpenProgress interface provides information about current progress through
  4508. // a download
  4509.  
  4510. [
  4511. object,
  4512. uuid(8E1C39A1-DE53-11cf-AA63-0080C744528D),
  4513. pointer_default(unique)
  4514. ]
  4515.  
  4516. interface IAMOpenProgress : IUnknown
  4517. {
  4518.     // QueryProgress can be used to query the source filter which supports this interface
  4519.     // for progress information during a renderfile operation.
  4520.     HRESULT QueryProgress(
  4521.           [out] LONGLONG* pllTotal,
  4522.           [out] LONGLONG* pllCurrent
  4523.          );
  4524.  
  4525.     // AbortOperation can be used to request an abort of RenderFile operation
  4526.     // causing it to stop downloading. This methods instructs the exporter of
  4527.     // the IAMOpenProgress interface to hold up their internal abort flag until
  4528.     // further notice.
  4529.     HRESULT AbortOperation(
  4530.         );
  4531. }
  4532.  
  4533.  
  4534. /*++
  4535.     IMpeg2Demultiplexer
  4536.  
  4537.     This interface is implemented by the MPEG-2 Demultiplexer filter,
  4538.     irrespective of program vs. transport stream splitting functionality.
  4539. --*/
  4540. [
  4541.     object,
  4542.     local,
  4543.     uuid (436eee9c-264f-4242-90e1-4e330c107512),
  4544.     pointer_default(unique)
  4545. ]
  4546. interface IMpeg2Demultiplexer : IUnknown
  4547. {
  4548.     /*++
  4549.         ------------------------------------------------------------------------
  4550.         purpose:    Creates an output pin of the specified media type.
  4551.  
  4552.         pMediaType      media type specifier for the new pin
  4553.         pszPinName      pin name; cannot be a duplicate of an existing pin
  4554.         ppIPin          IPin interface pointer to the newly created pin
  4555.     --*/
  4556.     HRESULT
  4557.     CreateOutputPin (
  4558.         [in]    AM_MEDIA_TYPE * pMediaType,
  4559.         [in]    LPWSTR          pszPinName,
  4560.         [out]   IPin **         ppIPin
  4561.         ) ;
  4562.  
  4563.     /*++
  4564.         ------------------------------------------------------------------------
  4565.         purpose:    Updates the media type of the specified output pin.  If no
  4566.                       connection exists, the media type is updated always.  If
  4567.                       the pin is connected, the success/failure of the call will
  4568.                       depend on downstream input pin's accetance/rejection of
  4569.                       the specified media type, and subsequent success/failure
  4570.                       of a reconnect.
  4571.  
  4572.         pszPinName      pin name
  4573.         pMediaType      new media type specifier
  4574.     --*/
  4575.     HRESULT
  4576.     SetOutputPinMediaType (
  4577.         [in]    LPWSTR          pszPinName,
  4578.         [in]    AM_MEDIA_TYPE * pMediaType
  4579.         ) ;
  4580.  
  4581.     /*++
  4582.         ------------------------------------------------------------------------
  4583.         purpose:    Deletes the specified output pin.
  4584.  
  4585.         pszPinName      pin name
  4586.     --*/
  4587.     HRESULT
  4588.     DeleteOutputPin (
  4589.         [in]    LPWSTR  pszPinName
  4590.         ) ;
  4591. } ;
  4592.  
  4593. //---------------------------------------------------------------------
  4594. // IEnumStreamIdMap interface
  4595. //---------------------------------------------------------------------
  4596.  
  4597. cpp_quote("#define MPEG2_PROGRAM_STREAM_MAP                 0x00000000")
  4598. cpp_quote("#define MPEG2_PROGRAM_ELEMENTARY_STREAM          0x00000001")
  4599. cpp_quote("#define MPEG2_PROGRAM_DIRECTORY_PES_PACKET       0x00000002")
  4600. cpp_quote("#define MPEG2_PROGRAM_PACK_HEADER                0x00000003")
  4601. cpp_quote("#define MPEG2_PROGRAM_PES_STREAM                 0x00000004")
  4602. cpp_quote("#define MPEG2_PROGRAM_SYSTEM_HEADER              0x00000005")
  4603.  
  4604. cpp_quote("#define SUBSTREAM_FILTER_VAL_NONE                0x10000000")
  4605.  
  4606. typedef struct {
  4607.     ULONG   stream_id ;                     //  mpeg-2 stream_id
  4608.     DWORD   dwMediaSampleContent ;          //  #define'd above
  4609.     ULONG   ulSubstreamFilterValue ;        //  filtering value
  4610.     int     iDataOffset ;                   //  offset to elementary stream
  4611. } STREAM_ID_MAP ;
  4612.  
  4613. /*++
  4614.     Enumerates the StreamIds mapped on a pin
  4615. --*/
  4616. [
  4617.     object,
  4618.     local,
  4619.     uuid (945C1566-6202-46fc-96C7-D87F289C6534),
  4620.     pointer_default(unique)
  4621. ]
  4622. interface IEnumStreamIdMap : IUnknown
  4623. {
  4624.     HRESULT
  4625.     Next (
  4626.         [in]                            ULONG           cRequest,
  4627.         [in, out, size_is (cRequest)]   STREAM_ID_MAP * pStreamIdMap,
  4628.         [out]                           ULONG *         pcReceived
  4629.         ) ;
  4630.  
  4631.     HRESULT
  4632.     Skip (
  4633.         [in]    ULONG   cRecords
  4634.         ) ;
  4635.  
  4636.     HRESULT
  4637.     Reset (
  4638.         ) ;
  4639.  
  4640.     HRESULT
  4641.     Clone (
  4642.         [out]   IEnumStreamIdMap **  ppIEnumStreamIdMap
  4643.         ) ;
  4644. } ;
  4645.  
  4646. /*++
  4647.     Implemented on the output pin.
  4648.  
  4649.     Provides the ability to map/unmap a stream_id to/from an output pin.
  4650. --*/
  4651. [
  4652.     object,
  4653.     local,
  4654.     uuid (D0E04C47-25B8-4369-925A-362A01D95444),
  4655.     pointer_default(unique)
  4656. ]
  4657. interface IMPEG2StreamIdMap : IUnknown
  4658. {
  4659.     HRESULT
  4660.     MapStreamId (
  4661.         [in]    ULONG   ulStreamId,                 //  mpeg-2 stream_id
  4662.         [in]    DWORD   MediaSampleContent,         //  #define'd above IEnumStreamIdMap
  4663.         [in]    ULONG   ulSubstreamFilterValue,     //  filter value
  4664.         [in]    int     iDataOffset                 //  elementary stream offset
  4665.         ) ;
  4666.  
  4667.     HRESULT
  4668.     UnmapStreamId (
  4669.         [in]    ULONG   culStreamId,                //  number of stream_id's in pulStreamId
  4670.         [in]    ULONG * pulStreamId                 //  array of stream_id's to unmap
  4671.         ) ;
  4672.  
  4673.     HRESULT
  4674.     EnumStreamIdMap (
  4675.         [out]   IEnumStreamIdMap ** ppIEnumStreamIdMap
  4676.         ) ;
  4677. } ;
  4678.  
  4679.  
  4680. //  Register a service provider with the filter graph
  4681. [
  4682.         object,
  4683.         local,
  4684.         uuid(7B3A2F01-0751-48DD-B556-004785171C54),
  4685.         pointer_default(unique)
  4686. ]
  4687. interface IRegisterServiceProvider : IUnknown
  4688. {
  4689.         // registers one service into it's internal table.. Object is refcounted.
  4690.         //   register a NULL value to remove the service
  4691.         HRESULT RegisterService([in] REFGUID guidService, [in] IUnknown *pUnkObject);
  4692. };
  4693.  
  4694.  
  4695.  
  4696. //---------------------------------------------------------------------
  4697. //
  4698. // IAMClockSlave interface
  4699. //
  4700. // When the audio renderer is slaving to a separate graph clock this
  4701. // interface provides a way for an app to specify how closely in sync
  4702. // the slaving renderer should try to stay to the graph clock. Note that
  4703. // using a larger tolerance for a video & audio playback graph will likely
  4704. // result in looser a/v sync, so it recommended not to change this setting
  4705. // except under special circumstances.
  4706. //
  4707. //---------------------------------------------------------------------
  4708.  
  4709. //
  4710. // Used to set/get the error tolerance used by a slaving audio renderer
  4711. //
  4712. [
  4713. object,
  4714.     uuid(9FD52741-176D-4b36-8F51-CA8F933223BE),
  4715.     pointer_default(unique)
  4716. ]
  4717. interface IAMClockSlave : IUnknown
  4718. {
  4719.     // set millisecond value to use for slaving tolerance
  4720.     // the allowed range is 1 to 1000ms
  4721.     HRESULT SetErrorTolerance (
  4722.         [in]  DWORD dwTolerance
  4723.     );
  4724.  
  4725.     // get millisecond value currently being used for slaving tolerance
  4726.     HRESULT GetErrorTolerance (
  4727.         [out]  DWORD *pdwTolerance
  4728.     );
  4729. };
  4730.  
  4731.  
  4732.  
  4733. //---------------------------------------------------------------------
  4734. //
  4735. // IAMGraphBuilderCallback interface
  4736. //
  4737. // Interface which gives the app a chance to configure filters
  4738. // before a connection is attempted.
  4739. //
  4740. // If this interface is supported by the site passed in to the graph
  4741. // via IObjectWithSite::SetSite, the graph will call back with each
  4742. // filter it creates as part of the Render or Connect process. Does
  4743. // not call back for source filters. Filter may be discarded and not
  4744. // used in graph or may be connected and disconnected more than once
  4745. //
  4746. // The callback occurs with the graph lock held, so do not call into
  4747. // the graph again and do not wait on other threads calling into the
  4748. // graph.
  4749. //
  4750. //---------------------------------------------------------------------
  4751.  
  4752. [
  4753.     object,
  4754.     uuid(4995f511-9ddb-4f12-bd3b-f04611807b79),
  4755.     local,
  4756.     pointer_default(unique)
  4757. ]
  4758. interface IAMGraphBuilderCallback : IUnknown
  4759. {
  4760.     // graph builder selected a filter to create and attempt to
  4761.     // connect. failure indicates filter should be rejected.
  4762.     HRESULT SelectedFilter(
  4763.         [in] IMoniker *pMon
  4764.         );
  4765.  
  4766.     // app configures filter during this call. failure indicates
  4767.     // filter should be rejected.
  4768.     HRESULT CreatedFilter(
  4769.         [in] IBaseFilter *pFil
  4770.         );
  4771. };
  4772.  
  4773. cpp_quote("#ifdef __cplusplus")
  4774. cpp_quote("#ifndef _IAMFilterGraphCallback_")
  4775. cpp_quote("#define _IAMFilterGraphCallback_")
  4776. cpp_quote("// Note: Because this interface was not defined as a proper interface it is")
  4777. cpp_quote("//       supported under C++ only. Methods aren't stdcall.")
  4778. cpp_quote("EXTERN_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);")
  4779. cpp_quote("interface IAMFilterGraphCallback : public IUnknown")
  4780. cpp_quote("{")
  4781. cpp_quote("    // S_OK means rendering complete, S_FALSE means retry now.")
  4782. cpp_quote("    virtual HRESULT UnableToRender(IPin *pPin) = 0;")
  4783. cpp_quote(" ")
  4784. cpp_quote("};")
  4785. cpp_quote("#endif // _IAMFilterGraphCallback_")
  4786. cpp_quote("#endif")
  4787.  
  4788. //------------------------------------------------------------------------------
  4789. // File: EncAPI.idl
  4790. //
  4791. // Desc: Encoder (and future decoder) interface definitions.
  4792. //
  4793. // Copyright (c) 1992 - 2002, Microsoft Corporation.  All rights reserved.
  4794. //------------------------------------------------------------------------------
  4795.  
  4796. struct CodecAPIEventData
  4797. {
  4798.     GUID guid;
  4799.     DWORD   dataLength;
  4800.     DWORD   reserved[3];
  4801.     // BYTE data[dataLength];
  4802. };
  4803.  
  4804. interface   IStream;                     //  forward declaration
  4805. //
  4806. //  Applications can pass the CODECAPI_VIDEO_ENCODER to IsSupported to test for video encoders
  4807. //  Similarly, the GUIDs for audio encoders, video decoders, audio decoders and muxes can be
  4808. //  used to test for the codec classification
  4809. //
  4810. //  See uuids.h for a more detailed list.
  4811. //
  4812. [
  4813.     object,
  4814.     uuid(901db4c7-31ce-41a2-85dc-8fa0bf41b8da),
  4815.     pointer_default(unique)
  4816. ]
  4817. interface ICodecAPI : IUnknown
  4818. {
  4819.     //
  4820.     // IsSupported():
  4821.     //
  4822.     // Query whether a given parameter is supported.
  4823.     //
  4824.     HRESULT
  4825.     IsSupported (
  4826.         [in] const GUID *Api
  4827.         );
  4828.  
  4829.     //
  4830.     // IsModifiable
  4831.     //
  4832.     // Query whether a given parameter can be changed given the codec selection
  4833.     // and other parameter selections.
  4834.     //
  4835.     HRESULT
  4836.     IsModifiable (
  4837.         [in] const GUID *Api
  4838.         );
  4839.  
  4840.     //
  4841.     // GetParameterRange():
  4842.     //
  4843.     // Returns the valid range of values that the parameter supports should
  4844.     // the parameter support a stepped range as opposed to a list of specific
  4845.     // values.  The support is [ValueMin .. ValueMax] by SteppingDelta.
  4846.     //
  4847.     // Ranged variant types must fall into one of the below types.  Each
  4848.     // parameter will, by definition, return a specific type.
  4849.     //
  4850.     // If the range has no stepping delta (any delta will do), the Stepping
  4851.     // delta will be empty (VT_EMPTY).
  4852.     //
  4853.     HRESULT
  4854.     GetParameterRange (
  4855.         [in] const GUID *Api,
  4856.         [out] VARIANT *ValueMin,
  4857.         [out] VARIANT *ValueMax,
  4858.         [out] VARIANT *SteppingDelta
  4859.         );
  4860.  
  4861.     //
  4862.     // GetParameterValues():
  4863.     //
  4864.     // Returns the list of values supported by the given parameter as a
  4865.     // COM allocated array.  The total number of values will be placed in
  4866.     // the ValuesCount parameter and the Values array will contain the
  4867.     // individual values.  This array must be freed by the caller through
  4868.     // CoTaskMemFree().
  4869.     //
  4870.     HRESULT
  4871.     GetParameterValues (
  4872.         [in] const GUID *Api,
  4873.         [out, size_is(,*ValuesCount)] VARIANT **Values,
  4874.         [out] ULONG *ValuesCount
  4875.         );
  4876.  
  4877.     //
  4878.     // GetDefaultValue():
  4879.     //
  4880.     // Get the default value for a parameter, if one exists.  Otherwise,
  4881.     // an error will be returned.
  4882.     //
  4883.     HRESULT
  4884.     GetDefaultValue (
  4885.         [in] const GUID *Api,
  4886.         [out] VARIANT *Value
  4887.         );
  4888.  
  4889.     //
  4890.     // GetValue():
  4891.     //
  4892.     // Get the current value of a parameter.
  4893.     //
  4894.     HRESULT
  4895.     GetValue (
  4896.         [in] const GUID *Api,
  4897.         [out] VARIANT *Value
  4898.         );
  4899.  
  4900.     //
  4901.     // SetValue():
  4902.     //
  4903.     // Set the current value of a parameter.
  4904.     //
  4905.     HRESULT
  4906.     SetValue (
  4907.         [in] const GUID *Api,
  4908.         [in] VARIANT *Value
  4909.         );
  4910.  
  4911.     // new methods beyond IEncoderAPI
  4912.  
  4913.     //
  4914.     // RegisterForEvent():
  4915.     //
  4916.     // Enable events to be reported for the given event GUID.  For DShow
  4917.     // events, the event is returned as
  4918.     //      (EC_CODECAPI_EVENT, lParam=userData, lParam2=CodecAPIEventData* Data)
  4919.     // where
  4920.     //      - the CodecAPIEventData is COM allocated memory and must be handled and freed
  4921.     //        by the application using CoTaskMemFree().
  4922.     //      - the userData is the same pointer passed to RegisterForEvent
  4923.     //
  4924.     // Each data block starts with the following structure:
  4925.     //      struct CodecAPIEventData
  4926.     //      {
  4927.     //          GUID guid;
  4928.     //          DWORD dataLength;
  4929.     //          DWORD reserved[3];     // pad to 16 byte alignment
  4930.     //          BYTE data[dataLength];
  4931.     //      }
  4932.     // The guid parameter identifies the event. The data associated with the event follows the
  4933.     // structure (represented by the variable length BYTE data[dataLength] array).
  4934.     //
  4935.     // If guid is equal to CODECAPI_CHANGELISTS, then data is an array of GUIDs that changed as
  4936.     // a result of setting the parameter, as follows:
  4937.     //      GUID    changedGuids[ header.dataLength / sizeof(GUID) ]
  4938.     //
  4939.     // The current array is limited, so a driver may send multiple messages if the array size is
  4940.     // exceeded.
  4941.     //
  4942.     HRESULT
  4943.     RegisterForEvent (
  4944.         [in] const GUID *Api,
  4945.         [in] LONG_PTR userData
  4946.         );
  4947.  
  4948.     //
  4949.     // UnregisterForEvent():
  4950.     //
  4951.     // Disable event reporting for the given event GUID.
  4952.     //
  4953.     HRESULT
  4954.     UnregisterForEvent (
  4955.         [in] const GUID *Api
  4956.         );
  4957.  
  4958.     //
  4959.     // SetAllDefaults
  4960.     //
  4961.     HRESULT SetAllDefaults(void);
  4962.  
  4963.     //
  4964.     // Extended SetValue & SetAllDefaults:
  4965.     //
  4966.     // Changes the current value of a parameter and returns back an alteration list
  4967.     //
  4968.     //  The secondary arguments return back a list of other settings
  4969.     //  that changed as a result of the SetValue() call (for UI updates etc)
  4970.     //  The client must free the buffer.
  4971.     //
  4972.     HRESULT
  4973.     SetValueWithNotify (
  4974.         [in] const GUID *Api,
  4975.         [in] VARIANT *Value,
  4976.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  4977.         [out] ULONG *ChangedParamCount
  4978.         );
  4979.  
  4980.     //
  4981.     // SetAllDefaultsWithNotify
  4982.     //
  4983.     HRESULT SetAllDefaultsWithNotify(
  4984.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  4985.         [out] ULONG *ChangedParamCount
  4986.         );
  4987.     //
  4988.     //  GetAllSettings
  4989.     //      Load the current settings from a stream
  4990.     //
  4991.     HRESULT GetAllSettings( [in] IStream* );
  4992.  
  4993.     //
  4994.     //  SetAllSettings
  4995.     //      Save the current settings to a stream
  4996.     //
  4997.     HRESULT SetAllSettings( [in] IStream* );
  4998.  
  4999.     //
  5000.     //  SetAllSettingsWithNotify
  5001.     //
  5002.     HRESULT SetAllSettingsWithNotify( IStream*,
  5003.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  5004.         [out] ULONG *ChangedParamCount );
  5005. }
  5006.  
  5007. [
  5008.         object,
  5009.         local,
  5010.         uuid(a8809222-07bb-48ea-951c-33158100625b),
  5011.         pointer_default(unique)
  5012. ]
  5013. interface IGetCapabilitiesKey : IUnknown
  5014. {
  5015.         HRESULT GetCapabilitiesKey( [out] HKEY* pHKey );
  5016. };
  5017.  
  5018. // -----------------------------------------------------------------------------------------
  5019. // From this point on, this is retained for backwards compatiblity only
  5020. // Do not use this for future encoders
  5021. // -----------------------------------------------------------------------------------------
  5022. [
  5023.     object,
  5024.     uuid(70423839-6ACC-4b23-B079-21DBF08156A5),
  5025.     pointer_default(unique)
  5026. ]
  5027. interface IEncoderAPI : IUnknown
  5028. {
  5029.     HRESULT IsSupported ( [in] const GUID *Api );
  5030.     HRESULT IsAvailable ( [in] const GUID *Api );
  5031.     HRESULT GetParameterRange ( [in] const GUID *Api,
  5032.         [out] VARIANT *ValueMin, [out] VARIANT *ValueMax,
  5033.         [out] VARIANT *SteppingDelta );
  5034.     HRESULT GetParameterValues ( [in] const GUID *Api,
  5035.         [out, size_is(,*ValuesCount)] VARIANT **Values,
  5036.         [out] ULONG *ValuesCount );
  5037.     HRESULT GetDefaultValue ( [in] const GUID *Api, [out] VARIANT *Value );
  5038.     HRESULT GetValue ( [in] const GUID *Api, [out] VARIANT *Value );
  5039.     HRESULT SetValue ( [in] const GUID *Api, [in] VARIANT *Value );
  5040. }
  5041.  
  5042. [
  5043.     object,
  5044.     uuid(02997C3B-8E1B-460e-9270-545E0DE9563E),
  5045.     pointer_default(unique)
  5046. ]
  5047. interface IVideoEncoder : IEncoderAPI
  5048. {
  5049. }
  5050. //---------------------------------------------------------------------
  5051. //
  5052. // Old Encoder API Interfaces
  5053. //
  5054. //---------------------------------------------------------------------
  5055.  
  5056. cpp_quote ("#ifndef __ENCODER_API_DEFINES__")
  5057. cpp_quote ("#define __ENCODER_API_DEFINES__")
  5058.  
  5059. typedef enum {
  5060.  
  5061.     //
  5062.     // Bit rate used for encoding is constant
  5063.     //
  5064.     ConstantBitRate = 0,
  5065.  
  5066.     //
  5067.     // Bit rate used for encoding is variable with the specified bitrate used
  5068.     // as a guaranteed average over a specified window.  The default window
  5069.     // size is considered to be 5 minutes.
  5070.     //
  5071.     VariableBitRateAverage,
  5072.  
  5073.     //
  5074.     // Bit rate used for encoding is variable with the specified bitrate used
  5075.     // as a peak rate over a specified window.  The default window size
  5076.     // is considered to be 500ms (classically one GOP).
  5077.     //
  5078.     VariableBitRatePeak
  5079.  
  5080. } VIDEOENCODER_BITRATE_MODE;
  5081.  
  5082. cpp_quote ("#endif // __ENCODER_API_DEFINES__")
  5083.  
  5084. cpp_quote("#define AM_GETDECODERCAP_QUERY_VMR_SUPPORT   0x00000001")
  5085. cpp_quote("#define      VMR_NOTSUPPORTED                0x00000000")
  5086. cpp_quote("#define      VMR_SUPPORTED                   0x00000001")
  5087.  
  5088. cpp_quote("#define AM_QUERY_DECODER_VMR_SUPPORT         0x00000001")
  5089. cpp_quote("#define AM_QUERY_DECODER_DXVA_1_SUPPORT      0x00000002")
  5090.  
  5091. cpp_quote("#define AM_QUERY_DECODER_DVD_SUPPORT         0x00000003")
  5092. cpp_quote("#define AM_QUERY_DECODER_ATSC_SD_SUPPORT     0x00000004")
  5093. cpp_quote("#define AM_QUERY_DECODER_ATSC_HD_SUPPORT     0x00000005")
  5094. cpp_quote("#define AM_GETDECODERCAP_QUERY_VMR9_SUPPORT  0x00000006")
  5095.  
  5096. cpp_quote("#define      DECODER_CAP_NOTSUPPORTED        0x00000000")
  5097. cpp_quote("#define      DECODER_CAP_SUPPORTED           0x00000001")
  5098.  
  5099. [
  5100.         object,
  5101.         local,
  5102.         uuid(c0dff467-d499-4986-972b-e1d9090fa941),
  5103.         pointer_default(unique)
  5104. ]
  5105. interface IAMDecoderCaps : IUnknown
  5106. {
  5107.         HRESULT GetDecoderCaps([in] DWORD dwCapIndex, [out] DWORD* lpdwCap);
  5108. };
  5109.  
  5110. ///////////////////////////////////////////////////////////////////////////////
  5111. //
  5112. // IAMCertifiedOutputProtection
  5113. //
  5114. ///////////////////////////////////////////////////////////////////////////////
  5115. typedef struct _AMCOPPSignature {
  5116.     BYTE        Signature[256];
  5117. } AMCOPPSignature;
  5118.  
  5119. typedef struct _AMCOPPCommand {
  5120.     GUID    macKDI;             //   16 bytes
  5121.     GUID    guidCommandID;      //   16 bytes
  5122.     DWORD   dwSequence;         //    4 bytes
  5123.     DWORD   cbSizeData;         //    4 bytes
  5124.     BYTE    CommandData[4056];  // 4056 bytes (4056+4+4+16+16 = 4096)
  5125. }  AMCOPPCommand, *LPAMCOPPCommand;
  5126.  
  5127. typedef struct _AMCOPPStatusInput {
  5128.     GUID    rApp;               //   16 bytes
  5129.     GUID    guidStatusRequestID;//   16 bytes
  5130.     DWORD   dwSequence;         //    4 bytes
  5131.     DWORD   cbSizeData;         //    4 bytes
  5132.     BYTE    StatusData[4056];   // 4056 bytes (4056+4+4+16+16 = 4096)
  5133. } AMCOPPStatusInput, *LPAMCOPPStatusInput;
  5134.  
  5135. typedef struct _AMCOPPStatusOutput {
  5136.     GUID    macKDI;             //   16 bytes
  5137.     DWORD   cbSizeData;         //    4 bytes
  5138.     BYTE    COPPStatus[4076];   // 4076 bytes (4076+16+4 = 4096)
  5139. } AMCOPPStatusOutput, *LPAMCOPPStatusOutput;
  5140.  
  5141.  
  5142. [
  5143.         object,
  5144.         local,
  5145.         uuid(6feded3e-0ff1-4901-a2f1-43f7012c8515),
  5146.         pointer_default(unique)
  5147. ]
  5148. interface IAMCertifiedOutputProtection : IUnknown
  5149. {
  5150.     HRESULT KeyExchange (
  5151.         [out]   GUID*  pRandom,             // 128-bit random number generated by Graphics Driver
  5152.         [out]   BYTE** VarLenCertGH,        // Graphics Hardware certificate, memory released by CoTaskMemFree
  5153.         [out]   DWORD* pdwLengthCertGH);    // Length of Graphics Hardware certificate
  5154.  
  5155.     HRESULT SessionSequenceStart(
  5156.         [in]    AMCOPPSignature*pSig);      // Concatenation of 128-bit random data security session key,
  5157.                                             // 128-bit random data integrity session key, 32-bit random
  5158.                                             // starting status sequence number and 32-bit random starting
  5159.                                             // command sequence number encrypted with the public key of
  5160.                                             // the graphic hardware. This value is 2048 bits long.
  5161.  
  5162.     HRESULT ProtectionCommand(
  5163.         [in]    const AMCOPPCommand* cmd);  // Encrypted command
  5164.  
  5165.     HRESULT ProtectionStatus(
  5166.         [in]    const AMCOPPStatusInput* pStatusInput,  // Encrypted Status request
  5167.         [out]   AMCOPPStatusOutput* pStatusOutput);     // Encrypted Status results
  5168. };
  5169.  
  5170.